13

Need help on AWK

view full story
linux-howto

http://www.unix.com – hi I have a delimited file 'file1' with 2 columns invoice number and code. Code: cat file1 8734111121,JFK 23112        ,LHR 45611110  ,ABH 780          ,B We need to find the last 8 characters of column1 and put it in the main file.If the number of characters is less than 8,we need to add '0' in start of column 1 so as to make it equal to 8 characters.The output file should look like : Code: 34111121JFK 00023112LHR 45611110ABH 00000780BCA The column1 in 'file1' can be of any length. Please give some solution. Modera (HowTos)