shenwei356 / shenwei356/csvtk

Join with some empty files

Open
#266 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Go
Stars
1.2k
Forks
96
PR merge metrics
No merged PRs in 30d

Description

Prerequisites
  • make sure you're are using the latest version by csvtk version
  • read the usage
Describe your issue
  • describe the problem
  • provide a reproducible example

Input files:

$ echo -e "f,c1\n1,2" > 1.csv
$ echo -e "f,c2\n3,4" > 2.csv
$ echo -e "f,c3" > 3.csv

Two first files works fine:

$ csvtk join -f f --na NA --outer-join 1.csv 2.csv 
f,c1,c2
1,2,NA
3,NA,4

But when including the empty file:

$ csvtk join -f f --na NA --outer-join 1.csv 2.csv 3.csv 
[WARN] no data found in file: 3.csv
f,c1,c2
1,2,NA
3,NA,4

it does not show!
Any way that it shoes up, but just all NAs? For example:

f,c1,c2,c3
1,2,NA,NA
3,NA,4,NA

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start from the csvtk join command and reproduce the behavior with the three CSV files shown in the issue, including the empty-header-only file. Trace how input files with no data are handled and make the result retain that file's column with NA values, while preserving the existing outer-join output.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
cli
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.