SOLVED

Importing Text Files: Tab-deliminated text files vs CSV's

Copper Contributor

I routinely create text files in non-excel programs that are often manipulated in excel by other users.

 

I was under the impression that csv was the preferred format for data that may be used by excel (I'm not sure where I got this impression; it may have been an old teacher). I may be misremembering, but I thought you could open a csv directly in excel and have the values separated into the right cells without going through the file import process.

 

However, a coworker told me that I should use Tab-delimited instead, claiming that csv's don't automatically open as excel spreadsheets which is much more convenient. I tested it and, lo and behold, she was right and the tab-delimited version opens automatically formatted into columns while the csv needs to undergo the file import process.

 

I have two questions:

 

1. Is there a setting on excel that can make it so that .csv's open automatically without needing to use file import? 

 

2. Are there any nuances or drawbacks to switching to Tab-delimited for my outputs in general? Is tab-delimited generally preferred?

 

2 Replies
best response confirmed by Eric_at_work (Copper Contributor)
Solution

@Eric_at_work 

The only difference is that tab is always tab, for "comma separated" separator could be not only comma but semicolon and in general, any other symbol. Default one depends on regional setting of your Windows, but in general could be changed on any other one. However, with that it could be side effect for other apps / files within your system.

Another way it to add as first line of csv file

sep=,

if comma is used by separator or

sep=;

if semicolon, etc.

For example, if click on such csv file

image.png

and such one

image.png

Excel opens it exactly the same way

image.png

 

Another point is that Excel could do some default transformation if you open csv file by double click. For example, 11-05 could be converted to November 05 of current year. Again, depends on regional settings. In such cases Import is more preferable since you may define columns type during the import. But will it be tab-delimited or comma-delimited - doesn't matter, they are imported by exactly same way.

Thanks for this explanation,

I hope our company's computer regional settings are all the same, but I'll keep that in mind when the outputs might be dates or other ambiguous formats.
1 best response

Accepted Solutions
best response confirmed by Eric_at_work (Copper Contributor)
Solution

@Eric_at_work 

The only difference is that tab is always tab, for "comma separated" separator could be not only comma but semicolon and in general, any other symbol. Default one depends on regional setting of your Windows, but in general could be changed on any other one. However, with that it could be side effect for other apps / files within your system.

Another way it to add as first line of csv file

sep=,

if comma is used by separator or

sep=;

if semicolon, etc.

For example, if click on such csv file

image.png

and such one

image.png

Excel opens it exactly the same way

image.png

 

Another point is that Excel could do some default transformation if you open csv file by double click. For example, 11-05 could be converted to November 05 of current year. Again, depends on regional settings. In such cases Import is more preferable since you may define columns type during the import. But will it be tab-delimited or comma-delimited - doesn't matter, they are imported by exactly same way.

View solution in original post