Question

How to change CSV column type

  • 29 July 2014
  • 1 reply
  • 15 views

I have a large CSV and apparently FME tries to identify the column type when a CSV reader is added to a workspace. I believe this is causing a failure in a writer when FME identifies a column as "number" but there are a few null values in the column. It appears the CSV writer crashes when it wants to write a "number" but the value is "null". How do I get FME to stop identifying columns that have null values as "number"? I am doing no calculations on this column; it just needs to get pushed through to the writer as it is found in the reader.

 

As a last resort (although painful) how do I change the column type manually to successfully deal with null values?

1 reply

I can't say forsure but I whould try a few things.

 

 

Maybe import the whole data base into a Access table. Access is very comtiable with Excel and if you open it up it can be easly done. Access has defined colums and you can set the column type under the design view so FME will know that it is a number or a text column.

 

 

Or

 

 

Maybe you can just use a string seracher and replace all null values with a 0. 

 

 

Also

 

 

What are type of database are you writing it to? make sure the database it is going to will accept "Null" or "empty" as a value.  Maybe you can set this in the reader but I am not sure. 

Reply