Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2008 Forums
 SSIS and Import/Export (2008)
 Tab Delimited csv File All Data is in 1 Column

Author  Topic 

jbates99
Constraint Violating Yak Guru

396 Posts

Posted - 2013-05-02 : 18:13:22
hi experts,

I'm trying to push out my resultset to a .csv as tab-delimited.

In my Flat File Connection, the settings are:
Format - Delimited
Column Names in the first row
The File Name points to an existing .csv file

Column-Delimiter is tab

The Preview is perfect - all data is lined up under the correct Column Heading

** The problem is that when I open the .csv file in Excel - the data is all in a single column.

What could I have done wrong?
Thanks for any help. Jack


visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2013-05-03 : 03:07:59
have you tried opening in textpad? it may be that excel shows them inside same column but values separated by commas

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/
https://www.facebook.com/VmBlogs
Go to Top of Page

jbates99
Constraint Violating Yak Guru

396 Posts

Posted - 2013-05-03 : 09:30:04
Thanks visakh16.

When I open the file with Notepad/Wordpad - it looks good. The Column Headings and the row data have spaces.

When I open it with Excel, the column headings are all bunched together. But the row data is separated by a few spaces between columns. Is this normal? I suppose it will work.

No commas, I'm using tab-delimited.
Thanks, Jack
Go to Top of Page

James K
Master Smack Fu Yak Hacker

3873 Posts

Posted - 2013-05-03 : 09:46:44
Excel interprets a file with .csv extension as indeed being a "comma separated file". There may be cleverer ways to do this, but usually what I do is rename it with another extension such as .txt and then use Excel's File->Open menu. That will cause Excel to prompt you for delimiters; select tab as the delimiter.
Go to Top of Page

jbates99
Constraint Violating Yak Guru

396 Posts

Posted - 2013-05-13 : 10:03:52
My mistake everyone. I discovered that the file has fixed-width columns. Now everything is good.
Sorry for the inconvenience.
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2013-05-14 : 00:54:35
Oh ok. That explains it
Glad that you got it sorted out.

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/
https://www.facebook.com/VmBlogs
Go to Top of Page
   

- Advertisement -