Skip to main content

I'm trying to write data to a csv. I have a uniqe identifier that has two leading zeros. When writing to a csv file the zeros are removed. When viewing the feature information window the attribute has a string value. When doing the same in the written csv it says 64 unsigned integer even though I have set it to string in the writer parameters. What am I doing wrong? Making sure FME writes it as a string will keep the leading zeros right?

Some clarification:

 

CSV reader feature attribute information (string)

imageCSV writer user attributes:

imageWritten CSV file (64 bit unsigned integer):

imageIt's like FME disregards the string type I chose in the writer settings, any idea how this is possible?


The writer setup seems fine, what does the string look like before it goes into the writer? Does it still have the leading zeros?


Did you check the output CSV in just a text editor? It could be that the issue is happening when FME is reading back in the CSV file?

 


I get no problems when writing to CSV with the default settings. When opening the CSV with notepad, the leading zeroes are still there.

When importing this CSV file, FME does initially interpret the values as integers, but you can override this by manually changing the data type to string.


@virtualcitymatt​ I hadn't thought of that, csv file has the leading zeros. @geomancer​ checking the output on the writer removes the leading zero's but cheching the csv file in notepad++ shows that they are still there. ..

Weird! But anyway, problem is fixed now. Thanks for getting back to me.


Reply