Removing the first row and first 2 columns from an excel file

Hi All,

I am downloading an excel file from SAP and it always gets downloaded in a way that the first row is empty and the first 2 columns are also empty like shown below:

Capture

I want to remove the first row and the first 2 column from this file so that it looks like below:

Capture1

Attached is the file
Book1.xlsx (10.4 KB)

Thanks

give a try on using a read range with range info: C2
the resulting datatable should be as expected and could used for rewriting to an excel

1 Like

This does the trick, But I need one more help the file format for me is .XLS and when I apply read range activity to this format is get this error : Read Range: Your stream was neither an OLE2 stream, nor an OOXML stream.

Also I forgot to mention the file has 1st row empty like below which I want to remove :

Capture2

Thanks

Hi

Hope the below steps would help you resolve this

  1. To read .xls file always use EXCEL activity where use a excel application scope and pass the file path as input

  2. Inside the scope use a READ RANGE activity and there mention the range like this “C2” and get the output as dt

  3. If you are facing issue again then try upgrading the excel package
    Go to Design tab → Manage Packages → Project Dependencies → Upgrade UiPath.Excel.Activities

  4. Now to remove that empty row use this activity
    Remove Datarow activity

Where mention in property panel like

Datatable- dt
Rowindex - 0

  1. Now use a WRITE RANGE activity and then pass dt as input and enable add headers property

Cheers @shekhawat.arjun1307

1 Like

use excel application scope with “insert/delete columns” and “insert/delete rows” activity.
make sure ChangeMode = “Remove”

1 Like

EXAMPLE.xaml (8.0 KB)

Very simple, try this !

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.