06-23-2009
Quote:
Originally Posted by
vidyadhar85
is your pattern is fixed??
I mean pattern is always 123456??
or you want to print only line 3 and 4 from all files??
Yes, the pattern is fixed
---------- Post updated at 07:04 PM ---------- Previous update was at 07:02 PM ----------
Quote:
Originally Posted by
anchal_khare
@dwgi32: from grep, you mean to say the output of lines itself?
you want the output of the latest file from third line onwards in a new file?
Yes. > a.txt
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I 'm trying to grep 2 fieldds on 2 differnt lines. Like this:
psit > file
egrep -e '(NS|ES)' $file. Not working. If this succeeds then run next cmd else exit. Pls Help
Gundu (13 Replies)
Discussion started by: gundu
13 Replies
2. Shell Programming and Scripting
Hi.
I have this format on a textfile:
VG Name /dev/vg00
PV Name /dev/dsk/c16t0d0
PV Name /dev/dsk/c18t0d0
PV Name /dev/dsk/c16t4d0
VG Name /dev/vg01
PV Name ... (6 Replies)
Discussion started by: jOOc
6 Replies
3. AIX
I have setof files with data and with same fields multiple times in each of the files.
for example:
file 1
name = mary kate
last name = kate
address = 123
street = abc
name = mary mark
last name = mark
address = 456
street = bcd
file 2
name = mary kate
last name = kate... (2 Replies)
Discussion started by: relearner
2 Replies
4. Shell Programming and Scripting
Sir
I have a data file e.g. DATA31082009. This file consists of several data files appended to that file. The size of each data file is different. The first line of each file starts with "44". I want to grep data from "44" to the preceding line of next "44" and save it as a individual file.... (10 Replies)
Discussion started by: chssastry
10 Replies
5. UNIX for Dummies Questions & Answers
I want to search files (basically .cc files) in /xx folder and subfolders.
Those files (*.cc files) must contain #include "header.h" AND x() function.
I am writing it another way to make it clear,
I wanna list of *.cc files that have 'header.h' & 'x()'. They must have two strings, header.h... (2 Replies)
Discussion started by: ritikaSharma
2 Replies
6. UNIX for Dummies Questions & Answers
hi
i have kind of below text in a file.
I want to get a complete paragraph starting with START and ending with before another START) which has a particular string say XYZ or ABC
START XYZ hshjghkjh 45 ljkfd
fldjlj d jldf
START 3493u ABC 454
4545454
4545454 45454
4545454
START ...... (3 Replies)
Discussion started by: reldb
3 Replies
7. UNIX for Advanced & Expert Users
How do you grep 'select * from table_name' string from a script if the select * and from table_name are on 2 different lines ? like
select *
from table_name
Any help would be greatly appreciated !!!
Thanks
RDR (4 Replies)
Discussion started by: RDR
4 Replies
8. UNIX for Dummies Questions & Answers
I want to grep multiple lines from a text file. I want to grep all lines containing X,Y and NA in a single command. How do I go about doing that?
This is what my text files look like:
rs1983866 0.0983 10 100016313
rs1983865 0.5994 X 100016339
rs1983864 0.3272 11 100017453
rs7077266... (2 Replies)
Discussion started by: evelibertine
2 Replies
9. UNIX for Dummies Questions & Answers
I would like to use grep to select multiple lines from a text file using a single-column text file. Basically I want to only select lines from the first text file where the second column of the first text file matches the second text file. How do I go about doing that? Thanks! (5 Replies)
Discussion started by: evelibertine
5 Replies
10. Shell Programming and Scripting
GM,
I have an issue at work, which requires a simple solution. But, after multiple attempts, I have not been able to hit on the code needed.
I am assuming that sed, awk or even perl could do what I need.
I have an application that adds extra blank page feeds, for multiple reports, when... (7 Replies)
Discussion started by: jxfish2
7 Replies