SSIS-Split the fixed length records from CSV

  • Hi All,

    The CSV file is fixed length with no delimeter, contains rows.

    ex:- single row contains

    1asdusa1Comp2Elctr3Mech1Engg2Degre

    sno,sname,scity,cno,cname,cno,cname,cno,cname,cno,cname,dno,dname,dno,dname,dno,dname

    1,asd,usa,1,Comp,2,Elctr,3,Mech,4,Fina,1,Engg,2,Degre

    Single row Contains- 3 datasets.

    Student (sno,sname) -1 row

    Class(cno,cname)- 4 rows

    Department(dno,dname)-2 rows

    How can i split Fixed length string records from the CSV file and inserting them into my local DB tables?

    Thanks in Advance..

    Sasidhar Pulivarthi

  • Pulivarthi Sasidhar (8/29/2011)


    Hi All,

    The CSV file is fixed length with no delimeter, contains rows.

    ex:- single row contains

    1asdusa1Comp2Elctr3Mech1Engg2Degre

    sno,sname,scity,cno,cname,cno,cname,cno,cname,cno,cname,dno,dname,dno,dname,dno,dname

    1,asd,usa,1,Comp,2,Elctr,3,Mech,4,Fina,1,Engg,2,Degre

    Single row Contains- 3 datasets.

    Student (sno,sname) -1 row

    Class(cno,cname)- 4 rows

    Department(dno,dname)-2 rows

    How can i split Fixed length string records from the CSV file and inserting them into my local DB tables?

    Thanks in Advance..

    Sasidhar Pulivarthi

    Either the file is fixed width, or CSV, but not both. CSV files contain delimiters (often commas) which split the fields. As your data has no delimiter, it is either fixed width, or useless.

    I say useless, because it appears (for example) that student name contains three characters, is that right? For a fixed-width import to work, the field widths have to be constant throughout the file - meaning that student name would always have to contain three characters. I don't know your data, but that seems unlikely.

    The absence of evidence is not evidence of absence
    - Martin Rees
    The absence of consumable DDL, sample data and desired results is, however, evidence of the absence of my response
    - Phil Parkin

  • Hi Phil,

    Thanks for info.

    Its fixed width file only....

  • So which bit is giving you problems? Are you able to import the file using a fixed-width flat-file connection manager? Or perhaps it is the breaking down of the data for import to multiple tables?

    The absence of evidence is not evidence of absence
    - Martin Rees
    The absence of consumable DDL, sample data and desired results is, however, evidence of the absence of my response
    - Phil Parkin

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply