09-07-2008
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi All,
I need to extract the last occurance of a pattern match. So far I've got the code below which extracts the first occurance. Any ideas how I can modify it so that it extracts the last?
BEGIN {}
{
if (data++ == 0)
... (17 Replies)
Discussion started by: pondlife
17 Replies
2. UNIX for Dummies Questions & Answers
I have gone through all the threads in the forum and tested out different things. I am trying to split a 3GB file into multiple files. Some files are even larger than this.
For example:
split -l 3000000 filename.txt
This is very slow and it splits the file with 3 million records in each... (10 Replies)
Discussion started by: madhunk
10 Replies
3. UNIX for Dummies Questions & Answers
Hi All,
How can i replace the n'th occurance in a file. ?
I have a property file like
EAR;_TrackingEAR;META-INF/application.xml;xml;context-root;1;valeur
EAR;_TrackingEAR;META-INF/application.xml;xml;context-root;2;valeur2... (2 Replies)
Discussion started by: subin_bala
2 Replies
4. Shell Programming and Scripting
Hi
I have a file which contains the following two lines which are same But I would like to insert the value=8.8.8.8 in the 1st occurance line and value=9.9.9.9 in the 2nd occurance line.
<parameter name="TestIp1" value="">
<parameter name="TestIp1" value="">
Please suggest (1 Reply)
Discussion started by: madhusmita
1 Replies
5. UNIX for Dummies Questions & Answers
There is scenario that i have to replace a pattern at the first 5 occurance in a file. say i need to replace 'abc' by 'xyz' at its first 5 occurance in a file a.txt,
can anybody help me how it can be done, i can do complete replacement of the pattern using sed throughtout the file. (1 Reply)
Discussion started by: palash2k
1 Replies
6. Shell Programming and Scripting
A PERL script that prints just the first occurrence of a string in a file and immediately exits (the string and the filename are the first and the second command line arguments; I used filehandle to open an input file). (1 Reply)
Discussion started by: aadi_uni
1 Replies
7. Shell Programming and Scripting
Hello
Im trying to grep for a string in grub.conf . I've used the -F option since its a long string, but when i execute, i run into errors. Script and output below.
GRUBPASSWD="password --md5 xyz"
if grep -Fxq $GRUBPASSWD /etc/grub.conf
then
.
.
output:
grep: unrecognized option... (5 Replies)
Discussion started by: bludhemn
5 Replies
8. Shell Programming and Scripting
Hello;
I have a file consists of 4 columns separated by tab. The problem is the third fields. Some of the them are very long but can be split by the vertical bar "|". Also some of them do not contain the string "UniProt", but I could ignore it at this moment, and sort the file afterwards. Here is... (5 Replies)
Discussion started by: yifangt
5 Replies
9. Shell Programming and Scripting
Hi all,
I have file structure as file.log
84t-rw-r--r-- 1 emily04 us_cms 24492717 Oct 5 13:29 vgtree_84_1_K3L.root
85t-rw-r--r-- 1 emily04 us_cms 50410380 Oct 5 16:06 vgtree_85_1_uZv.root
85t-rw-r--r-- 1 emily04 us_cms 50567380 Oct 5 16:06 vgtree_85_1_hjv.root
86t-rw-r--r-- 1 emily04... (4 Replies)
Discussion started by: emily
4 Replies
10. UNIX for Beginners Questions & Answers
Hi All,
From the below file. I need to get only the first occurrence and print. I tried to do it in separate grep not coming as expected
Original file
11001;1213;304;;;;;;;111020677.64;;;;;;;;;;;;;;;;;;;;;;;;;;
11001;1214;304;;;;;;;102376462.96;;;;;;;;;;;;;;;;;;;;;;;;;;... (5 Replies)
Discussion started by: arunkumar_mca
5 Replies