I have splitted files, from the main file.
The main file looks like this:
Y, ,09/30/16 10:48:40,c,1,.84054972,0,P,0,0,30,0,1,1,0,20X,1, ,09/30/16 10:48:40,c,b,,r,,F,,,,,,END
and i am splitting this file into many files depending on the string END. So in this case it will be splitted into two Files.
The name of the two splitted files are:
1.rslt.09-30-2016.10.17.43
1.rslt.09-30-2016.10.39.38
Now i want to take the bold part from the name of the file which is called date. and put it inside the splitted file in these locations
Y, ,Date,c,1,.84054972,0,P,0,0,30,0,1,1,0,20X,1, ,Date,c,b,,r,,F,,,,,,END
which means location 2 incase of the header and location 3 incase of normal line. I have the snippet for the split and while i am writting the file i am copying location 1 which has the value 1 into all upper columns. How can i write Date into locations 2 and 3 at the same time when i am writing the file?
The string date in the snippet is that date i want to put which is taken from the name of the file.