![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| mutliple files in the same directory | epi8 | Shell Programming and Scripting | 8 | 05-12-2008 11:04 PM |
| process mutliple files in the same directory | epi8 | UNIX for Dummies Questions & Answers | 1 | 05-12-2008 11:43 AM |
| How to split a field into two fields? | vbrown | Shell Programming and Scripting | 4 | 02-21-2008 03:50 AM |
| can Awk split my field on the . | oly_r | Shell Programming and Scripting | 6 | 10-26-2007 04:16 PM |
| Split a field in awk script | CamTu | Shell Programming and Scripting | 4 | 03-21-2005 01:03 PM |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#8
|
|||
|
|||
|
Thanks for the help era. But one more requirment needs to be included in the coding.
if we did not find any match for the given input from the file then it should not write a blank file. waiting for you replay Thanks Arun |
| Forum Sponsor | ||
|
|
|
#9
|
|||
|
|||
|
Could Somebody give me the Code.
Thanks Arun |
|
#10
|
|||
|
|||
|
Actually it's much simpler if you simply remove any zero-sized file after you're done. Would that be acceptable?
Code:
test -s have.not || rm have.not |
|
#12
|
|||
|
|||
|
thank you so much era.
|
|
#13
|
|||
|
|||
|
Hi era,
after exceuting the command egrep 'first|second|third' file1 file2 file3 >have. the output file is showing different values with the filename at the begening of each and every line. example is given below. content of file 1 arun RD002136823 1 madhu 11111111111 2 srini RD002136823 3 syam 22222222222 4 gauth 33333333333 5 laxmi 44444444444 6 ranjit RD002136823 7 ranga 5555555555 8 pmsat 66666666 9 content of file2 is subbu RD002136823 1 anil 11111111111 2 raju RD002136823 3 vaga 22222222222 4 kotra 33333333333 5 adapa 44444444444 6 amith RD002136823 7 arora 5555555555 8 vestha 66666666 9 after the command egrep RD002136823 $FILE1 $FILE2 > $FILE3 the out is like below arigmrec01.in:arun RD002136823 1 arigmrec01.in:srini RD002136823 3 arigmrec01.in:ranjit RD002136823 7 arigmrec03.in:subbu RD002136823 1 arigmrec03.in:raju RD002136823 3 arigmrec03.in:amith RD002136823 7 but i don't want the file name to come in the begening of each line. i need only the content of from both the files into another file. Waiting for ur replay. Thanks Arun |
|
#14
|
||||
|
||||
|
doing 'man egrep' yields :
Code:
-h, --no-filename
Suppress the prefixing of filenames on output when multiple
files are searched.
|
||||
| Google The UNIX and Linux Forums |
| Tags |
| regex, regular expressions |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|