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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to import such text file to sql server 1

Status
Not open for further replies.

yan19454

MIS
May 19, 2005
94
US
PATIENTID" "PATIENTIDNAME" "BILLINGHC" "BILLINGHCNAME" "CASES" "BILLINGHCPCS" "DISCHARGEDATE" "PRIMARYAPCCODE"
"12048583" "aCCcG ,JEAN " " " "NO BILL HCPCS " 1 0 "06/30/2006 " " "
"40000002" "aCE ,eiii " " " "NO BILL HCPCS " 1 0 "07/28/2005 " " "
"40000069" "EFTOFF ,Rboert " "83615" "LACTATE (LD) (LDH) ENZYME " 1 1 "07/28/2005 " " "
"40000069" "TESTA ,JUNK1 " "83735" "ASSAY OF MAGNESIUM " 1 1 "07/28/2005 " " "

How to import such file to the sql server ? Thanks.

I hope I do not need to look through the whole file to read line by line ?

Thx.
 
Is this a space-delimited text file???

I am not sure there is an option to import such a file, and I am away from a computer I can check on. My first thought is you could use VBScript toreplace " " with ", ", but then you run into troubles with the spaces within data. And also with what appears to be stray quotes.

I don't envy your predicament one bit. Good Luck,

Alex

Ignorance of certain subjects is a great part of wisdom
 
Thx. Thanks. I use space as delimite and text qualifiler as ". it solve the problem.
 
Ah I guess that is an option then. Glad it worked!

Alex

Ignorance of certain subjects is a great part of wisdom
 

Dude...if you are still working on this..

just one thing...make sure you RTRIM your fields when you import them...as they seem to have added space

Have had some probs in the past with the same...especially querying the data with added space in the values...

Hope its helpful!
-------------

TriggerHappy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top