How to delete multiple columns of an excel

Awesome
@kkpatel

@Palaniyappan But why Preserve Format property caused this issue ?

1 Like

Fine when Preserve format is enabled, the cells are read one by one, instead of being read in bulk.
But usually when this is checked for large files it may lead to performance issue, still it works for you and that amazed me
Any how this is how it works when preserve format is enabled

Cheers @kkpatel

I understand now that because i had checked the Preserve Format it was so slow and i was not able to understand what was happening in the background. After i unchecked the Preserve Format it started working.

1 Like

That’s great
Kindly let know for any queries or clarification
Cheers @kkpatel

Hi @Palaniyappan @lfcosta, I read the data into data table, did filtering through filter data table activity and the new data writing into a new csv file. Before that i am killing the previous csv file through Kill process (Process Name: EXCEL). Because its a huge file.

But while writing into a new csv file through write range the robot is closing. Check the screenshot. What to do for this ?
Bot hanged

Hi there @kkpatel, sorry for the late reply, was off for the weekend.

I see you’ve solved the initial problem w/ the read csv.

Now for this new issue. In either scenario (read the CSV via activity or read range from Excel Application Scope) the file wouldnt be open, as UiPath opens, reads, and closes the file.

Can you try a version of your workflow where you dont kill the Excel process?
Also (i have not tried this), but can you use the Excel Write Range to save the file? Could be that because of the big size of the file the write CSV is breaking.

@Palaniyappan @lfcosta I am getting this issue of robot getting closed if i am using write range. If i use Read CSV → Filter-> Write CSV i am not getting the robot getting hanged. Its smoothly working.

But the output csv file doesn’t look like before. All the data are mixed up and not proper. Not sure why.

@Palaniyappan @lfcosta After writing the CSV file by Write CSV activity all the columns are coming under one column, column A.

Hello, @kkpatel,

Usually that’s how Excel opens CSV files by default. You need the file in the CSV format for a specific reason? From what i understand your opening the CSV with Excel, why not use a Write Range and save the file as a XLS?

If you must save the file as CSV and want to edit manually in Excel, you can use the “Text to Columns” option in the Ribbon , and with the wizard convert the 1 column with values separated by commas into various columns.

Actually the problem was happening when at last I was saving either using Send Hotkey (ctrl+s) or Save Workbook activity. The format inside the file was changing.But once i removed the saving, the format is proper now. It auto saves.

Hi @Palaniyappan

Came across this code when i searching to keep only certain columns. My concern is you are using false value inside default view… will it filter data based on some value like unique value or will it give all the rows of the columns without any data loss.

Thanks,
ula

When False mentioned it will give all value
If True mentioned it will give only unique value

Cheers @Boopathi

1 Like