I am trying to write a script that writes to 5503 files one at a time
and then closes each file.
open a new file for read/write “w+”, process it, and then close the file
(for each of 5503 files one at a time.
The program reads in a ‘name’ file of 5503 names, uses DATA to read in
the filenames (with full path) to be opened, and a huge master file that
gets broken into the 5503 new files.
The program actually runs with no errors:
BUT DOES NOT WRITE TO INDIVIDUAL FILES!!
Before closing each file, I test to see if the file exists and it says
yes and also gives me a file size which is correct.
The master file has over 3,500,000 records so I won’t attach it.
Attached are the script and the ‘name’ files.
I should mention that I wrote a ‘brute force’ script that opens each
file by full path name (no DATA file of pathnames are used) processes
them and writes to them then closes each file and the program runs
creating the desired output (5503 files). But this is a huge script.
There has to be a better way. I can do (and have done) this in Perl.
Am I listing the filenames incorrectly.
Can I create an array of filenames and access them (iterate)?
Can you help me? Or direct me to someone who can help?
I would greatly appreciate it.
301 452 3259
3352 Tanterra Circle
Brookeville MD 20833