Read csv table regardless of whether it is a true csv or the French type
Read csv table regardless of whether it is a true csv or the French type
csv tables are widely used for storing data as 'comma-separated values'. This doesn't work, however, when the comma is also used as a decimal symbol, as is practiced in French or German, for example. The separator symbol for csv files then becomes a semi-colon. This is not problematic when you only work on one machine, but it causes problems when you collaborate with people who use different types of csv encoding.
read_tab(tab)
Arguments
tab: file name of a table to be read.
Returns
If the table is in one of the two formats described above, the stored table is returned.
Details
This function overcomes this problem by checking first, which of the two characters occurs most frequently in the table, assuming then that this is the separator symbol. It then opens the table accordingly.
Currently limited to files that are either comma-separated with point as decimal symbol or semicolon-separated with comma as decimal symbol. Files should also have a header.