BurntSushi / xsv

A fast CSV command line toolkit written in Rust.
The Unlicense
10.29k stars 317 forks source link

Transformation changes CSV file encoding #287

Closed theogaraj closed 2 years ago

theogaraj commented 2 years ago

Hello, first of all, thank you so much for creating such a great tool! I do a lot of CSV data wrangling and this has been very helpful.

Issue: Using xsv to select specific columns from a csv file and write them to a new file; original csv is us-ascii but the new file is utf-16le.

Command: xsv select 1,2,6,7,8 file_1.csv > file_2.csv

Environment: Windows 10 (running in Powershell).

Observations and other info:

I don't know that I'd call this an "issue" as I'm able to achieve my goal by switching to bash. But I'm curious why it happens and if there's just something simple I'm missing that can save me having to switch.

BurntSushi commented 2 years ago

I have no idea personally. I don't use Windows and don't understand why the file encoding would change on you silently. You'll need to talk to Windows experts.

theogaraj commented 2 years ago

Thanks for the quick response. Closing this out as I'm able to get it to work by switching to a bash shell. Hope this is useful for others who are facing a similar problem.