Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Reading in a flat file one line at a time how ?

Status
Not open for further replies.

stessie

Programmer
Nov 22, 2000
26
IE
Hi guys
I have to take a flat file which is not very well delimited and read it in one line at a time and pass each line individually to a stored procedure
Bulk insert is not suitable as the delimiters are not very clear
e.g.
this is one line
SEQ000002000000TRN ADD 1774710000000928 AUG 01 28 AUG 01 0400 00000000000040.39 0006.00000000000000002770.59 00000000000000.00 00000000000000.00 5706000130 AUG 01 0000

Any ideas?
;-)
Thanks in advance
 

A text file doesn't require delimiters in order to import with bulk insert or bulk copy. Have you learned about format files for BCP? A format file is used to define the layout of the text file you are importing. Bulk Insert in SQL 7 and 2000 can also use format files.

Alternatively, Data Transformation Services (DTS) has wizards that allow you define the format and you can even perform transformations, checks and tests on the data as it is imported. Terry L. Broadbent
FAQ183-874 contains tips for posting questions in these forums.
NOTE: Reference to the FAQ is not directed at any individual.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top