question

red68 avatar image
red68 asked

Read in layout for fixed width file and load

Suggestions on loading a fixed width file. We are receiving a fixed width file of about 1000 columns of varying length. We have a layout of all start and stop positions. I would like to read the layout and load the flat file without having to manually load the file using the import utility b/c it would take a while to click every position in the GUI of a 1000 column record. I have also created the table shell in SQL. If there is any way to quicking point to the file and read the position from the layout or sql table and then load it, this would be very helpful. Thanks!
ssis
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
Mister Magoo avatar image
Mister Magoo answered
My first thought is to 1. load the data as one column into a staging table 2. Load the layout into another staging table e.g. column_name,start,stop 3. Use some dynamic SQL generated from the layout table to parse the data table
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.