Hi All
I have got a fixed length file of 80bytes long.The first 4bytes of each record represents a client_number.I need to modify the client number based on another lookup file.
The lookup file contains 2 fields and a comma delimited file.The first line of the lookup file contains the header information.
For example,
The lookup file has a path /data and the name of the file is client_nbr.lkp.The layout of the file is as follows.
From_Nbr,To_Nbr
1212,1100
1425,1233
1520,1400
The path of the original 80byte fixed length file is /temp.This file doesnot contain any header info.
1212.............................<80bytes>
1000.............................<80bytes>
1500.............................<80bytes>
1425.............................<80bytes>
1520.............................<80bytes>
The first 4 digits are client nbr.We have to do a lookup on /data/client_nbr file on From_Nbr field and if it matches the client_nbr will be replaced in the 80byte file with the To_Nbr value.
The final file should be located in /temp and the file name will remain same with only client_nbr info changed for some records where the lookup entry is available.
The final file should look like
1100.............................<80bytes>
1000.............................<80bytes>
1500.............................<80bytes>
1233.............................<80bytes>
1400.............................<80bytes>
Please help me wring a script which will take the 80byte fixed length file as a parameter as this name of the file varies on a daily basis but the content remains the same.