qsv stats regards numbers with thousands separators as string #2554
-
Not sure if this is a feature or bug but I wanted to get the sum of all numeric columns but those columns which actually represent numbers but have comma thousands and millions separators are regarded as string. For example
Other things that would be nice for |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 3 replies
-
You can remove the separators using Lines 1881 to 1970 in fdb9ff7
The See https://github.com/dathere/qsv/wiki/Supplemental#stats-command-output-explanation As for removing "dataset stats", I'll add an option to suppress them. I added them because I needed them for other projects that use qsv, as it allows me to skip calling qsv For now, you can remove the
Moving this issue to Discussion. |
Beta Was this translation helpful? Give feedback.
-
The problem with apply is that you have to know ahead of time which columns to use. The pipeline shown at the beginning of this thread works without knowing that so it could be used on any csv file rather than having a file-specific pipeline for each file. It already works as is on any file but it only works if the numeric columns have no thousands separators.. |
Beta Was this translation helpful? Give feedback.
-
That requires that the user specify the columns but I was looking for something generic that could be applied to any file with just the file name as input but thinking about it some more we can just remove all commas; however, the problem becomes that it seems that
As I was hoping to do this without generating an intermediate file. This generates an error at the
At the expense of using xsv in addition to qsv this works. Note the
|
Beta Was this translation helpful? Give feedback.
-
With this minor modification it works!
|
Beta Was this translation helpful? Give feedback.
With this minor modification it works!