![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| A utility for sending complex email messages from the command line | iBot | UNIX and Linux RSS News | 0 | 06-06-2008 04:50 AM |
| Complex find grep or sed command | sjburden | Shell Programming and Scripting | 3 | 05-31-2008 09:45 PM |
| complex command substitution | spopuri | Shell Programming and Scripting | 5 | 05-24-2006 08:37 AM |
| advanced/complex uses of the find command | Perderabo | Answers to Frequently Asked Questions | 0 | 05-04-2004 01:13 PM |
| parse text or complex grep ? | jacost | UNIX for Dummies Questions & Answers | 4 | 04-29-2004 07:58 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
complex grep command
hi all
i have file call "list.log" which contains like this 00300 000024501043846 0 00300 000034531322871 0 00600 000000489100734 0 and so on .. the file goes like this example first row)from position 1-5 the lider number(300),position 7-21 id num(000024501043846), position 33 version number(0). i need to take every row in "list.log" file and to search file or files which : the file_name contain the lider number, and in the file i have one or more rows which contains the id num with the specific version. example to the first row in the "list.log" file 00300 000024501043846 0 result /usr/tmp1 name of file : file_num_id_00300_emp_56 result /usr/tmp4 name of file : file_num_id_00300_emp_65 the two files are contain this serial number 000024501043846 with version 0. the file_num_id_00300_emp_56 is a report ,the size of row is 132. the problem is that the rows are not with the same data lets says something like this : report for customer Alex Swed lider 300 id num date version 000024501043846 21/05/2007 0 car_number involv_num prcnt 1234 3 50% id num date version 0000299999999474 04/06/2007 1 according to the example the number of the files which contain all the data is two. file_num_id_00300_emp_56 file_num_id_00300_emp_65 i want to join the number of the files which the lider,id_num and version are contain in them.(that include even if the file appear twice in the same file) to the list.log file or to other file the final result should be lider id_num version number_of_appearances 00300 000024501043846 0 2 how shall i do that ? best regards |
| Sponsored Links | ||
|
|