bug-datamash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug-datamash] datamash fails to transpose files


From: Cristian Raducanu
Subject: [Bug-datamash] datamash fails to transpose files
Date: Wed, 30 Sep 2015 13:05:11 +0000 (UTC)

Hello !

I am using datamash (GNU datamash) 1.0.7 on archlinux Linux 4.1.6-1-ARCH #1 SMP PREEMPT x86_64 GNU/Linux
The package was build from archlinux AUR repository.

aur.git - AUR Package Repositories

I'm having the following problem:
datamash fails to transpose files when the number of fields in the last row is less than the number of fields in any other row.
The files I'm using are rather small (up to 10 columns/10 rows) and contain tab separated values. However, on some rows, sometimes values are missing.
Consider the following input:

#cat file5

342    T    T
380    C    A
392    T
450    C    T

#datamash --no-strict  transpose <file5

342    380    392    450
T    C    T    C
T    A    N/A    T

So far, everything works fine. However if I remove the last field in the last row:

#cat file6

342    T    T
380    C    A
392    T
450    C

#datamash --no-strict  transpose <file6

342    380    392    450
T    C    T    C

so it transposes up to the last field on the last line and ignores the rest... The output should be:

342    380    392    450
T    C    T    C
T    A    N/A    N/A

I'm able to consistently reproduce this in my tests and datamash only works OK when the number of fields in any other line is equal or less than the number of fields in the last line. The delimiter doesn't seem to matter, same thing happens with csv files.

Thank you for your time !

Chris




reply via email to

[Prev in Thread] Current Thread [Next in Thread]