hi
i am having a hard time with two kinds of text files that have kind of 'repeating groups' in them...i want to loop it, but dont know how.
one is a text file with a record length of 1200 bytes, but all 95601records are all on one row with no lf, cr or anything else between them, so i cannot feature how to get the forEach container to chop of a Right of claimchunk of 1200 bytes at a time, then go get the next 1200 bytes, because the items aren't stacked, they are adjacent to each other, if you see what i mean.
the other text file has a record lenght of 52 bytes with 28 bytes filler, but this file also goes 'down and across', meaning that here, there are fourteen 'rows' in the file, and they have thousands of lines too, so this one also has to consume all the columns on the row before it moves to the next row.
am i making this harder than it needs to be?
thanks for any light
This file is a "fixed-width" file. Setup a flat file connection manager, set it to fixed width, and then define your columns appropriately. Or define one column, of 1200 bytes long, to read in each record as one field. Up to you. From there, you have several options.|||thanks very much for your reply
yes, it is a fixed length file in the sense that the columns contained in each 1200 bytes occurr in the same place, but this also means that the entire 358MB of the file is on one line, so to appropriately define my columns means to create one column for each of the 96000+ records contained on that line in the file, so the structure of the data is not exactly what the fixed length file transform envisions, because in that assumption is an implicit end of line or end of record or some physical new line in the file...i dont have that.
So what i was imagining was using a ForEach loop iterator construct to get the loop to consume the line 1200 bytes at a time (how? i dont know) and push it into a variable and pipe that varialbe into a derived column (does it demand a table or can it work with a variable?) that would 'stack up' the 1200 byte package into the fixed length format described above, and then use that to finally parse the file into columns using the fixed length file as described, but my problem is how to recognize 200 bytes as a record first. if i define a 1200 byte fixed length file, i get exactly one record, the rest of the line is thrown out, because it doesnt fit into 'Column 0'.
thanks again
drew
|||A fixed width file does not have to use row delimiter. So if I have this data:
1 2 3
1 2 3
and I defined it as a fixed width file with three columns of 1 character each, the format SSIS expects is:
123123
Fixed width with row delimiters are actually considered ragged right by SSIS.
You shouldn't have to use a ForEach to read this - the flat file connection manager set to fixed-width should work fine.
|||it worked great...please forgive me for being dense.
No comments:
Post a Comment