Thanks to visit codestin.com
Credit goes to github.com

Skip to content

csvtk spread doesn't properly aggregate values for duplicated keysΒ #248

@MostafaYA

Description

@MostafaYA

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

csvtk spread does not collpase duplicated values when exits

$ cat test.txt 
sample  contig  gene    coverage 
sample1 contig_1        a       100
sample1 contig_2        a       70
sample2 contig_2        a       100
sample3 contig_3        a       100

$ csvtk cut -t -f 1,3,4 test.txt | csvtk spread  -t -k 2 -v 3
[WARN] duplicated record: a (70) for sample1 at line 3
sample  a
sample1 100
sample2 100
sample3 100

Desired output

sample  a
sample1 100;70 
sample2 100
sample3 100

BTW: there is also some typos in flags

-f should be -k or -v in the examples

  -h, --help           help for spread
  -k, --key string     field of keys. e.g -f 1,2 or -f columnA,columnB, or -f -columnA for unselect columnA
      --na string      content for filling NA data
  -v, --value string   field of values. e.g -f 1,2 or -f columnA,columnB, or -f -columnA for unselect columnA

Thank you

I'm grateful to users who have greatly helped to report bugs and suggested new features.

I may respond to issues or fix bugs quickly, but I usually implement new features periodically (two or more weeks).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions