please help


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users please help
# 1  
Old 03-01-2006
please help

Dear friends,

I am writing csh script to automate some process.

for that , i have one bulk dat file containing hex data .

i want to write perticular line by using idno into separate file.

for this solution grep command is enough are any commands are there.


my dat file has lihe this


Code:
 4302  2006/02/28  17:48:19.361  0  5 0E79C5 00D99C 07D21A 0284D7 0E62D1 0C6E0D 0D14E3 02C5E8 03741D 00FF70 000000 000000 000000

       4329  2006/02/28  17:38:42.464  0  5 094C2B 00DEDC 0BF71C 07BFD3 0B654A 0323E2 00592A 0A3A7C 068FF6 069A00 000000 000000 000000

       4334  2006/02/28  17:38:03.711  0  5 034C3B 00E01C 081F0D 0571B2 0F36F8 0D3633 0D2BED 04E4C9 0E31E4 0FBAD0 000000 000000 000000

       4355  2006/02/28  17:48:49.787  1  5 0979E7 00E2DC 041FC4 02F76E 081859 018BFC 055EEA 09CF0E 07B873 068AE0 000000 000000 000000

       4556  2006/02/28  17:48:09.83   0  5 03134E 01788C 060923 0014D2 025FFE 0D5B06 0E9A84 091709 0F0E7E 0229C0 000000 000000 000000

i want to write 4334 id data in to separate file .


how it is possible.

please help
# 2  
Old 03-01-2006
hi,

I guess grep command is enough for this,
are you facing any problem using grep, and if so what is it

Gaurav
# 3  
Old 03-01-2006
thank u friend,

i used grep command and extracted the required id data.

after extracting my data file like this.

Code:
  2132  2006/02/28  17:48:10.346  0  5 085F40 00401C 09581B 0112D4 034AB6 0581D9 04AF17 068AB5 00D962 0C9140 000000 000000 000000

from the above file.


now i want to write hex data starting from sixth field to end of line to a separate file.

then my data should like this.

Code:
 085F40 00401C 09581B 0112D4 034AB6 0581D9 04AF17 068AB5 00D962 0C9140 000000 000000 000000

how it possible.
# 4  
Old 03-01-2006
use awk command for this,

so from the begining do it like this

Quote:
<ur grep command> | awk '{print $6 $7 $8....fill up to $18}' > outfile
# 5  
Old 03-01-2006
yes thank u,


but some times the fileds lessthan 18 or greater than 18 then what is solution.

because, i want to put this script in to crontab .


some please remaind that one and give reply.
# 6  
Old 03-01-2006
anyone give me reply.
# 7  
Old 03-01-2006
Hi Rajan,

You are again breaking the rules of this forum.
Trust me there is really no use doing these things.
Be Patient someone will reply

Gaurav
Login or Register to Ask a Question

Previous Thread | Next Thread
Login or Register to Ask a Question