GerritGroot
Technical User
Hi,
Under Windows XP I made a little program to change words in huge text files (in fact three files of 1Gb, 1.8Gb and 7Gb) as normal text editors refuse to open these huge text files.
To do so, without an editor, I
- 1 - Open the input textfile
- 2 - Read one line only (so the program uses little memory, I don't read the whole file, but only one line)
- 3 - See if the word that has to be changed occurs in that line and if so change it within that string
- 4 - Write the eventually changed text line (string) to the output file and flush
Everything goes ok for the 1Gb and the 1.8Gb input files, however for the 7Gb text file it doesn't work anymore. As soon as EXACTLY 2Gb of the output text file have been written to disk, the program just get stuck forever.
Possibly this has somethng to do with OS dependent maximum file sizes, but the input file comes from windows as well and contains 7Gb of text.
How can I solve this?
Thanks,
Gerrit
Under Windows XP I made a little program to change words in huge text files (in fact three files of 1Gb, 1.8Gb and 7Gb) as normal text editors refuse to open these huge text files.
To do so, without an editor, I
- 1 - Open the input textfile
- 2 - Read one line only (so the program uses little memory, I don't read the whole file, but only one line)
- 3 - See if the word that has to be changed occurs in that line and if so change it within that string
- 4 - Write the eventually changed text line (string) to the output file and flush
Everything goes ok for the 1Gb and the 1.8Gb input files, however for the 7Gb text file it doesn't work anymore. As soon as EXACTLY 2Gb of the output text file have been written to disk, the program just get stuck forever.
Possibly this has somethng to do with OS dependent maximum file sizes, but the input file comes from windows as well and contains 7Gb of text.
How can I solve this?
Thanks,
Gerrit