Thank you Anil it worked. I would like UiPath to paste the data on the last row. What could I write in “Append after range” on “Append Range” activity to paste the data on the last row of the sheet?
Hi @ABHIMANYU_THITE1 & @Kartheek_Battu thanks! I couldn’t find “Assign” on my UiPath. Is there another way that I could find the last row of the sheet and use the “Append Range” activity?
Also, @postwick, do you know if you can copy and paste data from csv files or do I have to necesarily export to excel? I don’t see use activity for csv
Sorry, I did find a Read CSV activity actually. My issue here is that I have to select a certain range within the CSV files (to be copied and then pasted on the main excel file) and I can’t find this option. I also don’t see any “Use Csv File” resource.
You don’t need any “Use CSV File” scope activity. Just use the Read CSV activity on its own.
When you say select a certain range, what do you mean? You can read the whole CSV into a datatable and then remove the data you don’t want from the datatable. Then Write Range or Append Range to Excel.
If what you mean is the file isn’t just a raw CSV file but contains other unwanted text, you’ll have to show us the CSV file so we can recommend how to do that.
@postwick & @Anil_G thank you for the replies. Unfortunately, I can’t show the CSV file since it contains confidential information. The issue is indeed that the CSV file contains unwanted text in several columns. I would only like to extract columns A:G and exclude cols H:K. Was wondering if this could be done with the Read CSV activity or any other activitities? If this is not possible, then as you said Paul, I can just make the bot read the whole datatable, remove the unwanted data and append on the main file.
I didn’t mean unwanted columns. What I meant was some sort of, say, report format where there is a title and other information at the top before the CSV data actually starts.
If it’s just a raw, pure CSV file then just use the Read CSV activity to get it into a datatable. Then you can manipulate it however you want. For example, you can use the Filter Data Table activity to remove columns you don’t need.
You know what you can do that…use excel file and append range will workf or csv as input as well…just give csv in use excel and use append range and give the same for csv but the sheetname will be same as filename for csv always
Hey @Anil_G thank you for the response. I’ve been using your suggestion. So in short, I told UiPath to read 3 csv files using Read CSV activity and then “Output to” 3 different sheets in my UiPath notebook. I now would like to copy these 3 datasets (only including columns A:N) from the notebook, and then append them on a separate excel file (file 2) sheet that already contains some data. I’ve been trying to use the append range activity but I’m not able to make the robot to copy the data from column A to N until the last row of data. I’ve been trying to use this formula FileName.Sheet(“Sheet1”).Range(“A:N”) but it gives me an error. Any suggestions? Thank you very much