Hi all. I have some text/csv files which have data before the actual data that needs to be imported. For some information about the files, they are approximately 1.5 million rows each and there is 4 of them. In order to use these with UiPath, I need to remove the top x rows and the import this file into a datatable.
I currently have got the following in UiPath to remove the tops rows:
Hello! A quick thing you can try before looking further for a solution would be this: https://go.uipath.com/component/read-extra-large-spreadsheets
It’s been developed to work with big files, so maybe it can reduce the time you have now.
PS: Since this is for .xlsx, you would need to convert the csv’s to xlsx. If this is not a suitable solution, let us know and we can look for more options.
You could look to do this by code and the StreamReader class.
The process you have is likely taking a long time as it is reading all lines before deleting the lines you wish. The StreamReader will read them line by line, so you can get it to stop once it reaches the line you want and move onto the next file, making the whole process much quicker.
Here is an example.
Select the file provided when prompted. Review the input from the file versus what is output by the code in the console. You can see any lines containing “REMOVE” are removed.