I am getting a 250,000 line text file, and need to sort it, and place it into seperate text files according to like item numbers. Here's the catch - it's a fixed length file, with some odd spacing in it.
For instance...
1123foo 1 data...
1121foo 4 data...
1111foo 13 data...
1234foo 121 data...
I would need all '*foo 34' lines to end up in a foo34.txt file, as would the other foo* #'s need to be in the same name formatted files.
Notice the spacing issue, where the spaces after foo decrease as the number increases.
I *could* remove the spaces, but the lines need to remain a fixed length.
So, what I am losing sleep over is this:
I need to sort the text file into seperate text files with the like item #'s grouped together.
Any ideas??
For instance...
1123foo 1 data...
1121foo 4 data...
1111foo 13 data...
1234foo 121 data...
I would need all '*foo 34' lines to end up in a foo34.txt file, as would the other foo* #'s need to be in the same name formatted files.
Notice the spacing issue, where the spaces after foo decrease as the number increases.
I *could* remove the spaces, but the lines need to remain a fixed length.
So, what I am losing sleep over is this:
I need to sort the text file into seperate text files with the like item #'s grouped together.
Any ideas??