Read Column by number or index in Same column names sheet

Dear Team,

I have sheet with same column names, due to this i have to read the column by number or index, Please let me kow how to do it.

and i have to apply for each row for the column.

Thanks,
Amol

@Amol_Golhar

Inside the For Each Row activity, you can access the values of each column by their index using the item variable. For example, row(0) corresponds to the first column, row(1) corresponds to the second column, and so on.

Hey @Amol_Golhar

  1. Read Range to read the data into a DataTable.
  2. For Each Row** to iterate through the DataTable.
    Inside the loop, use Assign or other activities to work with row.Item(columnIndex) where columnIndex is the zero-based index of your target column.

Hi @Amol_Golhar

Try this :

Hope it will helps you :slight_smile:
Cheers!!

To read a column by index when there are duplicate column names in a DataTable, you can use the following approach :

  1. Read Range*: Use the ‘Read Range’ activity to read the data into a DataTable without adding headers.
  2. For Each Row*: Use a ‘For Each Row’ activity to iterate through each row in the DataTable.
  3. Access by Index*: Use the column index to access the data in the specific column you’re interested in. For example, row.Item(0).ToString would access the first column.

Here’s a snippet of how to use it in an ‘Assign’ activity inside the loop:

currentValue = row.Item(columnIndex).ToString

Replace columnIndex with the zero-based index of the column you want to access.

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