The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



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 05:50 AM
Complex find grep or sed command sjburden Shell Programming and Scripting 3 05-31-2008 10:45 PM
complex command substitution spopuri Shell Programming and Scripting 5 05-24-2006 09:37 AM
advanced/complex uses of the find command Perderabo Answers to Frequently Asked Questions 0 05-04-2004 02:13 PM
parse text or complex grep ? jacost UNIX for Dummies Questions & Answers 4 04-29-2004 08:58 AM

 
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1 (permalink)  
Old 11-21-2007
naamas03 naamas03 is offline
Registered User
  
 

Join Date: Sep 2005
Posts: 91
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 thisexample 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
 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 12:44 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0