I've already come up with a couple different ways to do this, and I don't doubt that you guys can come up with a couple more. Here's the situation:
It's something for work, and let's just say that I work for a rather large company . The data my team needs for one of our apps is not immediately available at our office; instead it's sent up every morning as a bunch of pipe-delimited text files. To make things easier for a couple of mainframe programmers, I've been given the task of consolidating all of these little files into a single, larger, fixed-record-length file that a mainframe job can pick up, rather than having to hunt for all the individuals.
The original data files average a few KB a piece. Doesn't sound like much, but in a worst-case scenario, I could be looking at processing 3,500+ of these in a single run. Under normal circumstances the number of files might be a few hundred up to about 1,000.
I might be nit-picking considering the server this will be running on (multi-CPU HP-UX box), but it's still good-to-know information, especially if I ever have to work on a less powerful machine. So, anybody have any suggestions? Do I:
a) create the consolidated file and then format that?
b) read and format the little files and append to the consolidated file as I go?
c) something else?
Nathan
It's something for work, and let's just say that I work for a rather large company . The data my team needs for one of our apps is not immediately available at our office; instead it's sent up every morning as a bunch of pipe-delimited text files. To make things easier for a couple of mainframe programmers, I've been given the task of consolidating all of these little files into a single, larger, fixed-record-length file that a mainframe job can pick up, rather than having to hunt for all the individuals.
The original data files average a few KB a piece. Doesn't sound like much, but in a worst-case scenario, I could be looking at processing 3,500+ of these in a single run. Under normal circumstances the number of files might be a few hundred up to about 1,000.
I might be nit-picking considering the server this will be running on (multi-CPU HP-UX box), but it's still good-to-know information, especially if I ever have to work on a less powerful machine. So, anybody have any suggestions? Do I:
a) create the consolidated file and then format that?
b) read and format the little files and append to the consolidated file as I go?
c) something else?
Nathan