Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Flat files without delimiters Expand / Collapse
Author
Message
Posted Monday, February 25, 2008 4:17 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Wednesday, April 14, 2010 4:01 AM
Points: 1, Visits: 11
Hi,

I have a flat file without delimiters. The format is like
L10123444 221
but Col1 = L;col2=1;col3=0123444 etc...

how to import this kind of flat file


Thanks in advance
Post #459606
Posted Monday, February 25, 2008 6:57 AM


SSC Eights!

SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!

Group: General Forum Members
Last Login: Friday, March 14, 2014 2:21 AM
Points: 912, Visits: 205
Use fixed length option in flat file connection manager






My Blog: http://dineshasanka.spaces.live.com/
Post #459655
Posted Monday, February 25, 2008 7:10 AM
Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Tuesday, November 12, 2013 8:44 AM
Points: 1,073, Visits: 6,334
In the SSIS Data Flow you would use a Flat File Source. Configure the sources connection manager to use the "Ragged right" format and mark where the columns should be delimited, including the appropriate row delimiter. In the Advanced options change the properties for each column, such as Column name, data type and width. Then connect that to your destination.

If the fields won't be in the same position and same width the above won't work. For that you could still use a Flat File Source and read each row to a single column, then split that row up within a Script Component.
Post #459660
Posted Monday, February 25, 2008 10:19 AM


SSC-Dedicated

SSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-Dedicated

Group: General Forum Members
Last Login: Today @ 7:25 AM
Points: 35,959, Visits: 30,253
karthi (2/25/2008)
Hi,

I have a flat file without delimiters. The format is like
L10123444 221
but Col1 = L;col2=1;col3=0123444 etc...

how to import this kind of flat file

Thanks in advance


All of the methods suggested, so far, are good and will do.

If you want absolute blinding speed, though, using Bulk Insert with a BCP format file will out perform just about anything else you can do. The information for a BCP format file is in Books Online.


--Jeff Moden
"RBAR is pronounced "ree-bar" and is a "Modenism" for "Row-By-Agonizing-Row".

First step towards the paradigm shift of writing Set Based code:
Stop thinking about what you want to do to a row... think, instead, of what you want to do to a column."

"Change is inevitable. Change for the better is not." -- 04 August 2013
(play on words) "Just because you CAN do something in T-SQL, doesn't mean you SHOULDN'T." --22 Aug 2013

Helpful Links:
How to post code problems
How to post performance problems
Post #459813
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse