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

csvplot: Interleave multiple CSV files with a common column #125

Open
Notgnoshi opened this issue May 19, 2024 · 1 comment
Open

csvplot: Interleave multiple CSV files with a common column #125

Notgnoshi opened this issue May 19, 2024 · 1 comment
Labels

Comments

@Notgnoshi
Copy link
Owner

File A:

x,y
0,0
1,1
2,2

File B:

x,y,z
0.5,0.5,1
1.5,1.5,2
2.5,2.5,3

Interleaved:

x,y,z
0,0,
0.5,0.5,1
1,1,
1.5,1.5,2
2,2,
2.5,2.5,3
  • Maybe use -, None, or null as a placeholder?
  • This should maybe be a separate tool outside of csvplot - csvjoin?
    • Maybe this is something that qsv already provides?
@Notgnoshi
Copy link
Owner Author

qsv can do this

$ qsv joinp --coalesce --full x,y 1.csv x,y 2.csv
x,y,z
0.5,0.5,1
1.5,-6.0,2
2.5,3.0,3
1.0,1.0,
0.0,0.0,
2.0,2.0,
(6, 3)

Note the extra shape (6, 3) line printed to stderr at the end. Useful for sanity checking

$ qsv joinp --coalesce --full x,y 1.csv x,y 2.csv | qsv sort -s x -N
x,y,z
0.0,0.0,
0.5,0.5,1
1.0,1.0,
1.5,-6.0,2
2.0,2.0,
2.5,3.0,3

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

No branches or pull requests

1 participant