I want to delete the first row (row 1) and Column “E” from a downloaded CSV file.
The problem I have is the file name changes each time it’s downloaded so I use a For Loop to open the most recent file. The “Delete Row” activity requires the file name which I don’t have because it changes each time
Well I have two solutions in mind the first one is to get the last file in download folder
Can you please try to use this step first instead of the LOOP
1- Click or what you do to download the file
2- In the property “delayafter” of the Click add a delay to wait the download (if it is neccesary)
3- Add an Assing activity with the following values
StringPathLastFile = Directory.GetFiles(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile) + “\Downloads”).OrderByDescending(Function(x) new FileInfo(x).LastWriteTime)(0)
*The number step numer 3 it’s to get the last file from the download folder
4- Use the Variable to read the File in the Delete Row or whetever you need it
The seconf solution is tou use an activity called “Wait for Download”, but please try the first solution, and let me know if that works, if not I will explain to you the second
Sorry, I should have added that I already have the file open by using “For Each File” loop activity to open it from the download folder so it has the focus. The problem is the “Delete Rows” activity wants a file name in the “in what table or range” field so I don’t know what to put in that field to satisfy it.