Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

windows end-of-line on linux #1076

Closed
teto opened this issue Aug 16, 2021 · 2 comments
Closed

windows end-of-line on linux #1076

teto opened this issue Aug 16, 2021 · 2 comments

Comments

@teto
Copy link

teto commented Aug 16, 2021

Hi,

I mentioned this on IRC but when saving a csv file on linux, I get CRLF endings instead of LF which messes up git diff etc.

$ vd --version
saul.pw/VisiData v2.5

To reproduce open a csv, edit a column and save the file with Ctrl+s .
cat -A toto.csv shows vstruct,,,,,$ before edition, after it shows vstruct,,,,,^M$ (notice the ^M). Is it possible to change the behavior to avoid this one way or another ?

NB: for now I run dos2unix after saving the csv.

@teto teto added the wishlist label Aug 16, 2021
@saulpw
Copy link
Owner

saulpw commented Sep 15, 2021

Hi @teto, VisiData uses the csv.writer from Python stdlib, and exposes the various dialect options. In this case, Dialect.lineterminator is set by default to '\r\n', and you can set it to what you want with --csv-lineterminator=$'\n'.

@teto
Copy link
Author

teto commented Sep 16, 2021

thanks for the pointer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants