I'm fairly proficient in SSIS, but by no means an expert. I have been tasked with importing a fairly complicated fixed width flat file with header and trailer rows. Now, without the header and trailer rows I feel confident I could do this fairly easily. However, I am stumped on how to do this with the extra rows. This is a simplified version for this example. First row is header row, last row trailer row between is any amount of data.
0 201308190102
1 123412341234 MR JOE BLOGGS 19810529
1 123412341235 MS SUE BLOGGS 19810516
9 201308190102
Columns are in header row : action type 0 = header, today's date YYYYMMDD, sequence number 01, expected row count 02
data row : action type 1,2,3 dependant on create, update, delete, card number 123412341234, title, firstname, lastname, date of birth trailer row : action type 9 = footer, today's date, sequence number, actual row count.
I'll need to do validation checks on the date, sequence number and row count of the files.
Now, I'm not sure how to set this up in the flat file connection manager as the header/trailer detail is in the same position as the card numbers.
So my thinking is split the header and trailer rows out by row number and end of file or something? Would I need to split them both out in a script task? Would I need to setup the flat file connection line by line and split out the columns by script task?