Aug 19 2021 01:56 PM
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?
Aug 19 2021 02:23 PM
SolutionThe 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
and such one
Excel opens it exactly the same way
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.
Aug 19 2021 02:32 PM
Aug 19 2021 02:23 PM
SolutionThe 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
and such one
Excel opens it exactly the same way
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.