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
combine functions behind to/from-c/tsv commands #990
Conversation
tests/filters_test.rs
Outdated
fn can_convert_table_to_tsv_text_and_from_tsv_text_back_into_table_using_csv_separator() { | ||
let actual = nu!( | ||
cwd: "tests/fixtures/formats", | ||
r"open caco3_plastics.csv | to-tsv | from-csv --separator '\t' | first 1 | get origin | echo $it" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this be caco3_plastics.tsv ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nevermind :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah yes! it should, good spot
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let me just force push over this, if that's ok with you?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sure, thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Although I think this test is correct. You are opening a csv file and getting a table, converting to tsv and using the expected from-csv
with the separator wanted in this case.
This is correct.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's slightly confusing... but yes, it wouldn't matter what format the file was as long as it reads as a table, then we make tsv text (so we add tabs) and then we parse that as csv separated by tabs...
I think this does the job of demonstrating that tsv
and csv --separator '\t'
are interoperable :D
fixes nushell#969, admittedly without a --delimiter alias moves from_structured_data.rs to from_delimited_data.rs to better identify its scope and adds to_delimited_data.rs. Now csv and tsv both use the same code, tsv passes in a fixed '\t' argument where csv passes in the value of --separator
a8e2878
to
b3c0218
Compare
* Updated the oh-my-posh setup guide * fixed typo
fixes #969, admittedly without a --delimiter alias
moves from_structured_data.rs to from_delimited_data.rs to better
identify its scope and adds to_delimited_data.rs. Now csv and tsv both
use the same code, tsv passes in a fixed '\t' argument where csv passes
in the value of --separator