|
Suppose to feed the filter standard input with these line:
line 1 line 2 line 3 line 4 line 5 line 6 line 7 line 8 line 9 line 10
It would be nicer if someone tell me how to write a script that prints only every 4 lines, in the case of the example input...
Started by Andrea Francia on
, 4 posts
by 4 people.
Answer Snippets (Read the full thread at stackoverflow):
Awk '{ if ((NR-1) %4 ==0) print}'
awk 'NR%4 == 1 {print}'</etc/hosts
Replace 4 by whatever value you want of course. .
Yes | cat -n | head -10 | awk 'NR % 4 == 1' 1 y 5 y 9 y
That is, your answer is " awk 'NR % 4 == 1' " .
|
|
I'm parsing a large file in Perl line-by-line (terminated by \n), but when I reach a certain keyword, say "TARGET", I need to grab all the lines between TARGET and the next completely empty line.
So, given a segment of a file:
Line 1
Line 2
Line 3
Line...
Started by ImSleeping on
, 9 posts
by 9 people.
Answer Snippets (Read the full thread at stackoverflow):
']'; __DATA__ Line 1 Line 2 Line 3 Line 4 Target Line 5 Grab this line Line 6 Grab this line Next Line
Edit Line 2 Line 3 Line 4 Target Line 5 Grab this....
|
|
Hello,
I'm parsing a source code file, and I want to remove all line comments (i.e. starting with "//") and multi-line comments (i.e. / .... /). However, if the multi-line comment has at least one line-break in it (\n), I want the output to have exactly...
Started by Rax Olgud on
, 6 posts
by 6 people.
Answer Snippets (Read the full thread at stackoverflow):
Added....
"line" "line 6" "line 7" "line ??" "line ??"
Edits:
Updated to new specification.
" /\n" ...
" \n" ...
"line 7 / \n" ...
"/* comment */line 6\n" ...
Of a comment*/ line 5\n" ...
|
Ask your Facebook Friends
|
In deploying a new version of our ASP.NET application, we need to set the authentication method for a particular page to be "Integrated only." We can do this from the IIS managment console, but would like to write a script (batch or powershell, doesn'...
Started by Brien on
, 4 posts
by 4 people.
Answer Snippets (Read the full thread at serverfault):
Alternatively, you could check out the System.DirectoryServices API for IIS 5 & 6 ( http.
|
|
Hi there, Im interested in trading my line 6 m13 with m9 reason is because i wanna save my space and also because im getting a motorbike soon so that it will be easier for me to carry. Top up will only be $50.
Started by guitarfreaks on
, 1 posts
by 1 people.
Answer Snippets (Read the full thread at soft):
|
|
Hi guys,
Got a virtually mint Bass Pod XT live (the floor unit) with PSU,manual and Line 6 gigbag for sale,£110 (and I'll even go halves on UK postage....wot a bargain!!!)
Pics on request
Cheers,
Steve
Edited by slapmonsta, 18 April 2012 - 05:24 PM.
Started by slapmonsta on
, 4 posts
by 3 people.
Answer Snippets (Read the full thread at basschat):
Thanks
John GOT A PICCY BUD?.
Bump Hi Is this still up for grabs..
|
|
Righto lads, funny story behind this one, but both for sale. They belong to a good friend of mine, but I have them here selling for him as he doesnt want ebay fees. Long time user of the XT, bought HD 400 as supposed upgrade last week. Didnt like its ...
Started by kev on
, 2 posts
by 2 people.
Answer Snippets (Read the full thread at ultimatemetal):
Hey, where are you located?.
|
|
Righto lads, funny story behind this one, but both for sale. They belong to a good friend of mine, but I have them here selling for him as he doesnt want ebay fees. Long time user of the XT, bought HD 400 as supposed upgrade last week. Didnt like its ...
Started by kev on
, 7 posts
by 4 people.
Answer Snippets (Read the full thread at ultimatemetal):
Bump before fleabay : P.
Do i get a piece of candy carpet with that POD?? Fancy trading the floor pod for a Korg KP3 ? Sorry dude, cash only on this one i'm afraid .
Hey, where are you located? Hey mate, Bristol UK here .
|
|
Righto lads, funny story behind this one, but both for sale. They belong to a good friend of mine, but I have them here selling for him as he doesnt want ebay fees. Long time user of the XT, bought HD 400 as supposed upgrade last week. Didnt like its ...
Started by kev on
, 1 posts
by 1 people.
Answer Snippets (Read the full thread at ultimatemetal):
|
|
Righto lads, funny story behind this one, but both for sale. They belong to a good friend of mine, but I have them here selling for him as he doesnt want ebay fees. Long time user of the XT, bought HD 400 as supposed upgrade last week. Didnt like its ...
Started by kev on
, 5 posts
by 4 people.
Answer Snippets (Read the full thread at ultimatemetal):
Do i get a piece of candy carpet with that POD?? Fancy trading the floor pod for a Korg KP3 ? .
Hey, where are you located? Hey mate, Bristol UK here .
|