This may seem a little odd but I have a program that each day collects between three and five payment files and sends them to an AS/400 where they are processed and submitted to a third party. For some reason the AS/400 program looks at the four digit (hhmm) file creation time in the file headers and if the time in a file is the same as in a preceeding file from that day it rejects it as a duplicate. (It is actually a little more complicated but most days that is what it bois down to.)
What I would like to do is open the files from within my program and change the fourth digit of that time stamp, incrementing it for each file in turn. Is there an easy way to change a single character in a known position (line 1, column 33) in a text file without having to read each line and write it to an output file? I could do it the long way but if there is a neat trick I would appreciate hearing it.
What I would like to do is open the files from within my program and change the fourth digit of that time stamp, incrementing it for each file in turn. Is there an easy way to change a single character in a known position (line 1, column 33) in a text file without having to read each line and write it to an output file? I could do it the long way but if there is a neat trick I would appreciate hearing it.