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

combine functions behind to/from-c/tsv commands #990

Merged
merged 1 commit into from Nov 19, 2019

Conversation

drmason13
Copy link
Contributor

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

@gitpod-io
Copy link

gitpod-io bot commented Nov 19, 2019

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"
Copy link
Member

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 ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nevermind :)

Copy link
Contributor Author

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

Copy link
Contributor Author

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?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure, thanks!

Copy link
Member

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.

Copy link
Contributor Author

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
@andrasio andrasio merged commit 388fc24 into nushell:master Nov 19, 2019
bobhy pushed a commit to bobhy/nushell that referenced this pull request Oct 22, 2023
* Updated the oh-my-posh setup guide

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

Successfully merging this pull request may close these issues.

combine csv and tsv functions behind [to/from]-[csv/tsv] commands
2 participants