0

I have the follwing txt file with quoted comma delimted file

"col1","Col2","col3","col4","col4","col5","col6","col7"
"text for col1","123 NW St, Suite 23",,,"12345","AZ"

I would have no problem with this, except sometimes in the street address has a comma, then bulk insert thinks it's a new column. then with empty records/values there are no quotes. I have seen some examples using the with format file. How wold I use a format file for this type of file?

bulk insert #temptbl
from 'C:\test\Test.txt' 
with (FORMATFILE='C:\test\formattest.txt',rowterminator='\n')

I also want to add, those empty filed when they have values, they have quotes.

eripey
  • 355
  • 1
  • 2
  • 13

0 Answers0