Open CSV File with Different Delimiter
I'm currently using the default Numbers application to open my CSVs. My current use case involves a file that I had to use a different type of separator (|
). Is there any way to change the separator? Right now when I open the file it just puts the entire row in one column.
In Numbers you can use any separator when importing csv tables.
On the format sidebar, in the table tab, look for adjust Import settings. Inside it you have delimited options where you can even use custom delimiters
Use sed
; the Stream EDitor from Terminal.
sed -i -e 's/"|"/|,"/g' filename
s
is used to replace the found expression "|" with ","
g
is for "global", meaning do this to the whole line. If you omit the g
option it will only replace the first instance, ignoring the rest
-i
option is to "edit in place" meaning it changes the file itself.
-e
option indicates the expression/command to run.
-
open your csv file in Numbers
-
You should see a
Adjust Settings
thing pop up, click it -
You'll see an
Import Settings
dialog make sure you click onDelimited
-
in the Custom Delimiter field add
|
-
Click
Update Table