Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help with search and replace

Status
Not open for further replies.

mfearnuk

Technical User
Apr 10, 2001
10
GB
Hi,

I was trying to use awk - but got a little lost to be honest
I have two files - I need to do a lookup on the first file to see what to update in the second file.

I need to be able to check any 2 fields in file 1 to be equal to x and y from those results where contents of file1.$1=file2.$1 then update any field in the second file

i.e search (00000008) and replace (00000000) file2.$3 where file1.$1 = file2.$1 and file1.$4="DK0000" and file1.$5="dk"

file one looks like

000003E8|00000000|00000000|DK0000|dk||0|0000000A|01048576|01048576|00000000|00000000|00000000|00000000|0|0||||||||

file two looks like
00001007|00719CC0|00000008|00000000|00000000|03036732|00000000|03036732|00000000|00000000|00000001|3A3AA276|3A3AA276|3A3E8DB6||||||||||||||||||||||


Thanks in advance

Martin
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top