Monday, March 26, 2012

Text File Processing

I am currently working on a project in which the user will upload a flat file, text file, for processing and manipulation. I am unable to control the format of the test file because it comes from a packaged software. The file is a fixed delimited file that I must read certain value from and write out a new text file in a new format.
The problem that I am having is the starts with a 12 line header that I can through way because the first 12 line will always be the same. Where my problem is that at certain points during the file a sub set of the header file will occur. There does not seem to be any rhyme or reason as to where the entry occurs.
Does anyone have any idea how how to check for this line pattern and how I can ignore it?What I've done in cases like this is to import the file into anintermediary table, delete any rows which contain header information,and insert the remaining records into the final destination table.

0 comments:

Post a Comment