Extracting Header Column from Extracted Table Data

Hi,

I used the extract table data activity to scrape a table from a pdf, and it gets the correct data except when I use the expression ExtractedTable.Rows(0)(0).ToString to retrieve the cell value, it gets the second row of the first column instead of the first row.

Is there a way to get the value in the first row and first column of the extracted table? Not sure if this is because the data wizard thinks it’s a header column

Thanks

@Ii_Mariko

You can always turn off use first row as header..during extraction you can check in preview

Cheers

Hi Anil,

This is what pops up when I press Preview in table extraction, do you mind showing me where I can turn the setting off?

Uncheck the “The data in this table has headers” option in the Extract Table Data wizard. Then ExtractedTable.Rows(0)(0).ToString will give you the correct first row, first column value.

Do you mind showing me where it should be?? Sorry I’ve been trying to find it, but I don’t see an option like that anywhere

1 Like
  1. In the Extract Table Data wizard, after indicating your table, look at the bottom-left corner of the preview window.
  2. Uncheck the box labeled “The data in this table has headers” (or similar).
  3. Click Finish.

Now ExtractedTable.Rows(0)(0).ToString will return the actual first row, first column value, not the second row.

During the “Extract Table Data” configuration, uncheck the “First row is header” or “My table has headers” option in the extraction wizard. This will make your actual first row accessible via ExtractedTable.Rows(0)(0).

Do you have a “Table Settings” property filled for the extract table data activity? If so, check if the “AddCvHeader” value is set to true in it. If it is set to true, change it to false and give it a try.

Thanks for the suggestion, I tried doing that but it still doesn’t output the first row

@Ii_Mariko

I see the inssue in the new extract table if the header row is having TD with TH then it goes with this…so a work around would be to massage the data before..for that we can insert a new row at top and add the column names as the values so that the first row is added

Make sure you click on filter icon in activities and select developer, dt is the datatable

two steps

  1. Invoke method …InsertAt with dt.Rows as input and dt.Newrow() to add empty row and position as 0 which is the first row
  2. For each on dt.columns with assign inside with dt.Rows(0)(currentDataColumn.ColumnName) = currentDataColumn.ColumnName

Sample implementation

cheers

1 Like

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