6

I need to be able to save files created in LibreOffice Calc to CSV with the CRLF line endings.

I have tried many options but the files always come out missing the CR part.

I work with programs that will not import the CSV files without the windows line endings.

Adam
  • 341

2 Answers2

2

Line termination is not part of the CSV specification. It depends on the operating system. If you work on linux you get LF; if you use windows, CRLF. When exporting any kind of text files from linux to windows a conversion tool is required: unix2dos.

1

I was automating a bunch of other stuff so I thought I would automate this also.

Using the Unix2dos command mentioned above; I now press F12 (open terminal in current folder) and type csv.

This is aliased to 'unix2dos *.csv' which is much faster then re-opening the files every time. I have tested that unix2dos doesn't do anything weird to the file if it is run more then once on the same file.

Notes: Getting F12 to open a terminal in the current folder. go to ~/.local/share/nautilus/scripts add a scripts called whatever (Terminal) in the script place

# !/bin/sh
gnome-terminal

Then go to ~/.config/nautilus/script-accels and add the shortcut you want; I set F12.

F12 <script name> (Terminal)
Adam
  • 341