I have two text file....
One text file contain in this format......
keyvalue.txt
second text file looks like this......
samplesource.txt
Now i want to compare each element of key.txt with samplesource.txt.
Ex:
\SUM\SUM_cam.c exist in samplesource.txt.
If it is found then put a (%) symbol before \SUM\SUM_cam.c in key.txt and
cut the element after second @ and put it in key.txt
Mean Now Key.txt should look like this:
NOTE:
samplesource.txt may conatin \SUM\SUM_cam.c so many times.
But we should concentrate our search to the first occurance...........
Hope you got my point guys..................
Last edited by Yogesh Sawant; 08-27-2010 at 09:37 AM..
Hello again,
I have put together a shell script using sed and some shell commands, and it runs pretty well when I am in terminal, but when I save it as a text file and invoke it through the terminal by typing its path, all I get are errors.
Can some one give me some hints as to what I am doing... (13 Replies)
Hi,
I want to compare two columns from file1 with another two column of file2 and print matched and unmatched column like this
File1
1 rs1 abc
3 rs4 xyz
1 rs3 stu
File2
1 kkk rs1 AA 10
1 aaa rs2 DD 20
1 ccc ... (2 Replies)
Is it possible to replace a line of text within a file while it's closed with a single command or a script? Please show me an example or point me to a webpage that shows an example. The file has this line of text:
LoginGraceTime 100
I want to replace it with the following:
... (2 Replies)
Hi,
I need to compare 2 text files with around 60000 rows and 1 column. I need to compare these and write the mismatch data to 3rd file.
File1 - file2 = file3
wc -l file1.txt
58112
wc -l file2.txt
55260
head -5 file1.txt
101214200123
101214700300
101250030067
101214100500... (10 Replies)
Hi All,
I have the below text file from which I have to cut particular section starting from PTR_Security_Rpeorting.cpf to PTR_Security_Reporting_Env93_export.
Report Model............: "D:\Cognos_Publishing\tmp.a2R94KLQec"\PTR_Security_Reporting.cpf
Report Output Script....:... (4 Replies)
Hi All,
I ahve requirement where I want to put the text file in into proper format. I am wondering how can i achieve that:-
Host/Alias Name IP Address Resolved
sinuiy01.infra.go2uti.com 10.240.8.158 N
sinuid20.devtst.go2uti.com 10.240.8.230 N
sinuid21.devtst.go2uti.com... (6 Replies)
Hello everyone, I need to write a shell script for a file consisting of 3 columns, first column is frequency the second one is power and the last one is number of occurence. I basically need to get the power and the frequency corresponding to the highest number of occurrence number. Below is the... (6 Replies)
hi guys
i have this very messy script, that looks in /var/log/messages.all for an error and reports if it finds the key works
how can i get it to look at more then one file, i.e /var/log/message.all *
so it looks in old logs as well
thanks
exit 0 if (isRenderNode(hostname));
my... (4 Replies)
Hi!
I have a need to do this in Perl.
script.pl -config file
The script would be doing a wget/LWP on a URL which is defined in the config file.
So when I run the script it should return either one of these conditions -
1) OK with exit status 0.
Should also print "wget URL"
2)... (6 Replies)
I need to look at a log file every half hour or so to make sure that some activity is going on there. I thought I would write a quick PERL script that would copy the current log file to the temp directory, compare it to the previous log file (from 30 minutes ago) and exit with an error status if... (1 Reply)