Adding Extra row values to CSV file which was Data Scraped

Hi,

As part of my exercise, I have done data scraping on a site and exporting it to a csv file. Now, I want to add an extra column in the CSV file with a value called prices. this price is not part of the main page, which is of secondary page. however, it’s fetching its values. But I want it append to existing CSV or add it.

I had searched in other forums here. some had suggested to use Add Data Row or Add Data column. I tried it unable to proceed further.

Also, I am unable to attach workflow here. since it says I am the first time user.Not allowing me to attach.

Thank you

Do you want to append the price column to csv? or fetch it from secondary page and then move?

Goto a particular website, search for mobiles and URL via data scraping, click on Product and Fetch the prices, collect the other information not present in main page and populate the same data in Column A, Column B and Column C.

Column A and Column B are taken from Data Scraping and Column C value fetched separately and should be added to Data Scraped and Exported CSV.

if this stored as a datacolumn variable then we can use ADD DATA COLUMN activity where we can mention the datacolumn variable and the datatable variable where we want to add this

Cheers @stonecold

Goto a particular website, search for mobiles and URL via data scraping, click on Product and Fetch the prices, collect the other information not present in main page and populate the same data in Column A, Column B

  1. Upto Here - You have a Excel/ CSV with Column A, Column B.
  2. Use ReadRange on the above Data . This will give you a DataTable . (Say DT1).

For Column C value fetched separately and should be added to Data Scraped and Exported CSV.

  1. Read the Column C Data into a Other DataTable (Say DT2).

Now you have 2 DataTable.

  1. DT1 - with Column A and Column B
  2. DT2 - With Column C
  3. use JoinDataTable Activity -Join the Datatable using the common Key (common_column)
  4. Store the result into a new DataTable(OutputDT)
    5.Write the Datatable (OutputDT) to excel

Join
You can Swich between JoinType as per your requirement


Mukesh

1 Like

As detailed out above, my Case I have created two “ExtractDataTable” and Another named “Prices”, as per what was described above.

what goes actually into Column Table 1 and Column Table 2 ? I am bit confused here.

Thanks

Data Table is stored as “ExtractDataTable” variable
Second Page Click Captures the Prices stored as Integer variable. called Prices

As detailed above

I added for Add Data Column Properties with below

Column : Prices Error Thrown At properties → (Value Type Integer cannot be converted to System.data.datacolumn) --I tried converting integer to string still noLuck
DataTable: ExtractDataTable (This got accepted)

InputDatatable 1 : ExtractDataTable
InputDatatable 2 : Prices

ColumnTable1 and ColumnTable 2 Specifies ColumnNames in the Datatables.

Eg :
ExtractDataTable has a Column Called Id
Prices DataTable has a Column Identity.

Assuming Id of ExtractDataTable is same as Identity of Prices .

Then you specify :
ColumnTable1 = Id
ColumnTable2 = Identity


Mukesh

You need have unique identifier in each of the table to match and merge.