openmolecules.org Forum - RDF feed
type: channel
description: Forum about DataWarrior and other openmolecules.org related issues
items: How to change the data type in a column?
items: Re: How to change the data type in a column?

How to change the data type in a column?
type: item
description: 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.
creator: jenninaj
date: 2015-11-19T16:46:56-00:00

Re: How to change the data type in a column?
type: item
description: 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
creator: thomas
date: 2015-11-24T20:25:47-00:00

Re: How to change the data type in a column?
type: item
description: 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.
creator: jenninaj
date: 2015-12-11T15:48:02-00:00

Re: How to change the data type in a column?
type: item
description: Empty cells are still considered numerical unless they contain invisible characters, e.g. spaces.
creator: thomas
date: 2015-12-12T13:45:09-00:00