Hi All,
I get a file on weekly basis from client. I need to write a script which make sure the file should have 20 columns after the first column. If not then the script should add the remaining columns and default them to space(except for 2nd and 3rd). and at the same time the script should check the second and the third column if null then default those to ND.
Sample Input file:
0000000000||3|MAIL ORDER|MAIL ORDER DATA|N/A|MAIL ORDER|N/A|
0000010001|CASH||CASH|CASH|N/A|CASH|N/A|
0000020002|FFS MED|2|AL MEDICAID|MEDICAID|N/A|AL MEDICAID|N/A|"Tier2,PA|NPF"
Sample Outfile Required:
0000000000|ND|3|MAIL ORDER|MAIL ORDER DATA|N/A|MAIL ORDER|N/A| | | | | | | | | | | |
0000010001|CASH|ND|CASH|CASH|N/A|CASH|N/A| | | | | | | | | | | |
0000020002|FFS MED|2|AL MEDICAID|MEDICAID|N/A|AL MEDICAID|N/A|"Tier2,PA|NPF"| | | | | | | | | | |
Any help appreciated. Thanks in advance