12-14-2021 02:58 AM
Hi
I am trying to avoid a row can anyone give some solution (vi Or which blocks to be used) for this.
I need to avoid a entire row because there are some special characters no need of that row, I need to avoid that row and continue to read other rows and columns and save all data except special character rows it in another csv.
12-14-2021 04:05 AM
Correct me if i am wrong...
So you are reading a csv, then you want to remove all those special character row and then save it to another file???
12-14-2021 09:21 AM - edited 12-14-2021 09:22 AM
Right off the top of my head I would probably...
12-14-2021 09:54 AM
Do you know the index of the row?
Just read the entire file as a 2D array, delete the row, write the smaller 2D array to a new file.
12-14-2021 10:51 AM
@altenbach wrote:
Do you know the index of the row?
Just read the entire file as a 2D array, delete the row, write the smaller 2D array to a new file.
Read the entire file into an array
Search the array row by row for special characters
Delete the row containing special characters
Save the array to a file
12-14-2021 11:11 AM
Do you know that there is only one row with special characters or could there be multiple? What is your definition of a "special character"? You have not even explained if the fields are numeric or strings.
There are many ways to optimize all this, of course. Can you attach a simple example file?