2 Replies Latest reply: Aug 8, 2012 5:16 AM by 905160 RSS

    How to format date with in the file

    905160
      Hi,

      I have the below data in a file,

      101 02100002111406893401207310900A094101xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
      5200xxxxxxxxxx D18000_1 CCDXXXXXXX JUL 31201207 1140689340000001
      622113010547999999999003 000333333334RE 00030137 onee SYSTEM 0140689340000001
      62200000 0000999999999001 0000011111CR460 00030135 twoo system 0140689340000002
      82000000040015507087000000000000000003571110D18000_1 140689340000001

      Can some one tell me how to read the date which is there in line 1 which is starting with indicator 1 at position 24 to 29

      in this example it is 120731

      which is in YYMMDD format
      I want to replace from 70 to 75 with above date + 2 as 120802 in 2nd line which starts with indicator 5

      My output should look like below in a file again

      101 02100002111406893401207310900A094101xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
      5200xxxxxxxxxx D18000_1 CCDXXXXXXX JUL 31120802 1140689340000001
      622113010547999999999003 000333333334RE 00030137 onee SYSTEM 0140689340000001
      62200000 0000999999999001 0000011111CR460 00030135 twoo system 0140689340000002
      82000000040015507087000000000000000003571110D18000_1 140689340000001

      Can some one please tell me how to do this?

      Appreciate your response.