Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.
Searching by line number
Name: Jim Date: December 1, 2002 at 22:10:43 Pacific OS: UNIX CPU/Ram: 512
Comment:
Hello,
I have a data file I'm searching. I know the line numbers that the data I want is in. I now want to extract only those lines in the file and output them to a new file. How do I do that using grep or awk. Thank you very much in advance.
the above will use the '.' as a wild card matching all, the -n flag to grep will prepend line numbers. The '^30:' says give me line 30. The cut portion says to peel off the line number and present the balance.
0
Response Number 2
Name: Jim Date: December 2, 2002 at 12:47:20 Pacific
Summary: I need to extract data from a flat file with a package name(ABC.XYZ.W)with other packages too. Eg. | 12345678| 993600| ABHUY | WIGB | 98765432| 995640| DSGFKDSJGS ...
Summary: Hi, I wrote the following code to read a file line by line #!/bin/ksh for i in `cat a.txt` do echo $i done This is not showing me the file contents line bye line. Instead I am seeing a word by word ou...
Summary: I am attempting to find a particualr line in a file and then replace it. Unfortunatly i can only guaruntee the content of the line prior to the one i am trying to edit. I have used grep -n and a cut...