I am attempting to use
to convert a file into a string so that I can convert a few characters within the file.
The following general approach worked well on a small file, but on a BIG file I ran into problems.
For this specific test the FILETOSTR resulted in a 22820066 byte string (a typical file size for production runs). And this worked well so far and it accepted the BIG file into the variable with no problem.
But when I attempt to change the variable contents with something like:
I got an error message:
String too long to fit
So I took another approach...
I next tried to segment the string into parts
But I again got the error message:
String too long to fit
Yes I could most likely do the whole thing with Low Level File operations, but this was a much quicker approach.
Any suggestions on how to approach changing a character or two within the BIG string so that I can use the STRTOFILE() to re-write it back in its modified form?
Thanks,
JRB-Bldr
Code:
mcString = FILETOSTR(MyZipFile.zip)
The following general approach worked well on a small file, but on a BIG file I ran into problems.
For this specific test the FILETOSTR resulted in a 22820066 byte string (a typical file size for production runs). And this worked well so far and it accepted the BIG file into the variable with no problem.
But when I attempt to change the variable contents with something like:
Code:
mcString = STUFF(mcString,22820019,1,CHR(01))
String too long to fit
So I took another approach...
I next tried to segment the string into parts
Code:
mcLeftString = LEFT(mcString,22820018)
mcRightString = SUBSTR(mcString,22820020)
mcNewChar = CHR(01)
mcString = mcLeftString + mcNewChar + mcRightString
String too long to fit
Yes I could most likely do the whole thing with Low Level File operations, but this was a much quicker approach.
Any suggestions on how to approach changing a character or two within the BIG string so that I can use the STRTOFILE() to re-write it back in its modified form?
Thanks,
JRB-Bldr