Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Change 1 character in the first line of a text file?

Status
Not open for further replies.

jbradley

Programmer
Sep 7, 2001
248
US
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.
 
Never mind. I found it in a response by strongm to an earlier question. thread222-1401352
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top