I have a file with data in single row as DL2016-12-02PREMIUM             PW5038               X800901180118       59036CO00400010180421          0755480            HEALTH            B   NOT APPLICABLE                                    NOT APPLICABLE     2016-08-012016-12-022016-09-012016-08-312016-09-302016-09-012016-09-30949569014            PW5018             07554800010001089200001       00100010892                   00000010304MDIRECT    00000000000000000000{          HPS                           PW5018COCOAA007708200000010304DXQ7262016001                                                                                          I am trying to get data in this format 0000001030.4M 00000000000.0{Command used by me is cut -c 385-396,415-427 Filename|sed 's/./&./10'|sed 's/./& /13'|sed 's/./&./25'Please let me know an easy way to accomplish this.I have to this to complete file with any number of rows.I will get the data by the using awk '{print substr($0,385,10).substr($0,395,2) substr($0,415,11).substr($0,426,2)}' FilenameNow there is one more thing i am looking for. I want to replace 0000001030.4M 00000000000.0{ M and { with -1 and 5 respectively.This should look like -0000001030.41 00000000000.05.
Fetching and replacing data from a Unix file
text processing