The Altair Community is migrating to a new platform to provide a better experience for you. In preparation for the migration, the Altair Community is on read-only mode from October 28 - November 6, 2024. Technical support via cases will continue to work as is. For any urgent requests from Students/Faculty members, please submit the form linked here
[SOLVED] Write TSV
Hi,
I need to write an "Example set" as a tsv file.
I'm trying to use the "Write CSV" operator.
What kind of value can I insert in "column separator" field?
The value "\t" seems to work only in "Read CSV" .....
Thanks in advance for support
I need to write an "Example set" as a tsv file.
I'm trying to use the "Write CSV" operator.
What kind of value can I insert in "column separator" field?
The value "\t" seems to work only in "Read CSV" .....
Thanks in advance for support
0
Answers
Here's the case
Bye
a1|a2|a3|a4|id|label
5.1|3.5|1.4|0.2|id_1|Iris-setosa
4.9|3.0|1.4|0.2|id_2|Iris-setosa
4.7|3.2|1.3|0.2|id_3|Iris-setosa
Which error message are you getting?
The point is that I need that the columns are separated by Tab character to complete my data process .... This is a first part of an ETL process and the output file will be processed by another program .... that needs tab separators
Bye
I manually created a tab separated file, then I read it with the "read CSV" operator, and chose "tab" as separator (again, while READING). Then, I went to the settings of this operator, and just copied whatever was in the field "column separator). It looked empty, but I just double clicked in it, then copied. You may also just double click between the two brackets below, and copy (without the brackets)
( )
Then, paste this as column separator into your "write CSV operator".
I hope that works, it did the job for me. I opened the generated file in LibreOffice and indicated "tab" as delimiter, and it opened as expected.
But just follow the procedure as I described, and copy the field separator value from the "read CSV" to the "write CSV operator", this should do the job.
I know it doesn't look very smooth, but I hope it gets you a step forward...
Or, here's the code for the operator:
To get a tab character into the parameter, you have to copy it from somewhere. You can e.g. press tab in a normal text editor and copy the resulting (seemingly empty) character into RapidMiner.
Best regards,
Marius
Your solution works perfectly for my purpose !!!!!
Thanks also to Marius
Bye
Good luck with your project.