03-14-2014
You can do all of this using a single awk script instead of "while grep and echo"...
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Can someone please help me figure out what the command syntax I need to use is?
Here is what I am wanting to do.
I have hundreds of thousands of files I need to look for a specific search string in.
These files are spread across multiple subdirectories from one main directory.
I would like... (4 Replies)
Discussion started by: btrotter
4 Replies
2. Shell Programming and Scripting
Hi
i need a help for making a script whch can print next line if it matches a particular word
like file1 have
ename Mohan
eid 2008
ename Shyam
eid 345
if scipt got Mohan it will print next line (eid 2008)
pls help me .......:) (2 Replies)
Discussion started by: anish19
2 Replies
3. Shell Programming and Scripting
I have a directory with a large # of files and in each file I am looking to match a string in one file with a string in the subsequent n file(s). If there is a match between a string in one file and a string in the next n file(s) then delete the subsequent duplicate file(s). Here is sample input:
... (2 Replies)
Discussion started by: sitney
2 Replies
4. Shell Programming and Scripting
Hello Gurus....
Can any one please let me know how to print entire xml if the vlaue in the xml matches to a variable given. In PERL.
example:
<rpad:systemId>abc</hcdd:systemId>
<rpad:hcdd>1172</hcdd:hcdid>
</get:Request></soapenv:Body></soapenv:Envelope>
if value macthes 1172 I... (3 Replies)
Discussion started by: thankful123
3 Replies
5. Shell Programming and Scripting
Hi all,
I got several lines line this
a b c d e 1 e
a 1 c d e 3 f
a b c 1 e 8 h
a b c d e 1 w
a 1 c d e 2 w
a b c d e 1 t
a b c d e 7 4
How can I print the line if 1 is the field one before the last field?
Basicly this 2 field ?
a b c d e 1 e
a b c d e 1 t
The file I got is... (7 Replies)
Discussion started by: stinkefisch
7 Replies
6. Shell Programming and Scripting
Hi,
I am looking for a way to compare two text files and print the matches. For example;
File1.txt
89473036
78474384
48948408
95754748
47849030
File2.txt
47849030
46730356
16734947
78474384
36340047
Output: (11 Replies)
Discussion started by: lewk
11 Replies
7. UNIX for Dummies Questions & Answers
Im not sure how to tell this awk command to only print when there is a match between the two files. Right now its printing the words in quotation even if there is not a match. I tried removing the additional info and it prints blank spaces??
awk ' {
IP = $1
$1 = ""
}
FNR == NR {
... (2 Replies)
Discussion started by: sectech
2 Replies
8. Shell Programming and Scripting
Hi all,
I have two files, chap.txt and complex.txt.
chap.txt looks like this:
a
d
l
m
r
k
complex.txt looks like this:
a c d e l m n j
a d l p q r
c p r m
......... (7 Replies)
Discussion started by: AshwaniSharma09
7 Replies
9. UNIX for Dummies Questions & Answers
Hi all,
I have a problem that I'm struggling to resolve. I have two files that look like this:
File 1
654654654 3
987987987 2
321321321 1
File 2
14NS0064 654654654
14NS0054 654654654
14NS0032 654654654
14NS0090 987987987
14NS0093 987987987
14NS0056 321321321
As you may notice,... (2 Replies)
Discussion started by: winkleman
2 Replies
10. Shell Programming and Scripting
Hi All,
I have a file testarun.txt contains the below lines and i want to print the lines if the character positions 7-8 matches 01.
201401011111
201401022222
201402013333
201402024444
201403015555
201403026666
201404017777
201404028888
201405019999
201405020000
I am trying the... (4 Replies)
Discussion started by: Arunprasad
4 Replies