Hi,
I try to load csv file to database but unfortunately all fields in csv file are seen as string ( maybe leading spaces are the reason of that ).
I want to remove the leading spaces and map those fileds to corresponding fileds in table ( just put trim() and str2XXX() in every transformation ). How can I do this automatically? There are almost 200 column therefor writing code is not an option.
I hope I described the problem clearly.
Hi tussotammu,
first change your metadata fields to data types you like. Or prepare one-line big data without spaces and generate metadata from it - types should be detected properly. After this, data should be read - conversion will be done automatically (despite spaces).
Then if you use UniversalDataReader, you can set its property “Trim strings” - your strings will be trimmed after read.
I created https://bug.javlin.eu/browse/CLD-3860 for improvement of current behavior.
Thanks, It helps me but there is one more thing.
If I have quoted fields like
“32275482”|“809”|“81”|“1”|“Aaaaa
Bbbbb”|“2453305”|“2453305”|“”
then clover doesn’t recoginse type and see all fields as string.
If I prepare a record without the quotes then the program recognizes the type correctly.
But in my case I have to keep the field in quotes because sometimes it is a new line in the middle of a string.
As for me, recognizing types should work regardless of the quotations.
In extraction dialog, second page, in the middle section there is option to set “Quote char”. Does it help?
I have tried this before and unfortunately it didn’t help.
You’ve right…setting this and pressing “reparse” will just properly read multiline data. Types are not guessed properly. I will adjust reported issue.
I’m glad I could help.
P.S Do you need one more developer in your team (as a volunteer ;)) ?
Up!
I think there is one bug more connected with quotes.
Trim/Skip blanks dont work.