Forum about DataWarrior and other openmolecules.org related issues
How to change the data type in a column?
When importing a text file with a column that contains a mix of numbers (e.g. 1500.0, 9.3, etc.) and blanks datawarrior appears to cast this column as text. However, I cannot find a way to change the data type back to numbers and/or how to tell datawarrior during file import time that the column should be treated as numerical. Am I missing an obvious function/command or is this basic requirement lacking from the current version of DW? Thanks.
Re: How to change the data type in a column?
The data type is determined automatically. If DataWarrior cannot perceive numerical content, it would not help, if you would declare the column to be numerical. I suggest to clean the data, e.g. with search & replace. If a column contains multiple numerical values, they either need to be in separate lines or they should be delimited by '; '. In your case it may already fix the issue, if you replace ', ' by '; '. Hope this helps, Thomas
Thanks. I've confirmed that this occurs when a field in a column contains only numbers but some other fields in the column are blank. I was surprised that based upon the blank/empty fields that DW then interpreted the entire column as text.
Empty cells are still considered numerical unless they contain invisible characters, e.g. spaces.