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
Getting rid of the first three lines of a csv file (wizard)
Hello,
The csv file to be imported has three useless lines (rows) at the top.
In the fourth line attribute names are found.
From the fifth line onwards numeric values are found.
While I can select only the useful data in the first window of the wizard with the mouse, this selection is not used by the wizzard, as next wizard windows still contain the useless data at the top and due to that I can't get the right attributes.
This behaviour contrasts with the excel wizard where I can effectively select and use the rows that I want.
Is there another way to get rid of these three first lines?
Cheers
Francisco
The csv file to be imported has three useless lines (rows) at the top.
In the fourth line attribute names are found.
From the fifth line onwards numeric values are found.
While I can select only the useful data in the first window of the wizard with the mouse, this selection is not used by the wizzard, as next wizard windows still contain the useless data at the top and due to that I can't get the right attributes.
This behaviour contrasts with the excel wizard where I can effectively select and use the rows that I want.
Is there another way to get rid of these three first lines?
Cheers
Francisco
Tagged:
0
Answers
you could manually add a comment symbol as the first character in the first 3 lines, e.g. '#'. That way these lines would be skipped.
However you are correct that the functionality differs from the excel import wizard, and I have created an internal ticket for the issue.
Regards,
Marco
Do you think that a new versión can change this behaviour?
Cheers
Francisco
somewhere down the road, yes. However I fear it is not near the top of our priority list.
Regards,
Marco
in the 3rd step of the wizard you can specify the Comment annotation for the first 3 rows. That should get the work done. However I agree that using the selection as in the Excel operator is way more intuitive.
Best regards,
Marius
Thanks
Francisco
I thought of the annotation method when reading this post the other day, but when trying it out found that it wasn't working on a simple CSV example with 3 lines at the beginning to ignore followed by a heading row. Do you get problems on a CSV containing the following data?
Some text here
Some text here
Some text here
Att1,Att2,Att3,Att4
1,Apple,6,8
2,Orange,4.4,3
3,Banana,2.2,11
Replace the Create Document operator with a Read Document operator to read a csv file from disk.
Concerning the problems with your example file I have created an internal ticket.
Best regards,
Marius