Hi everyone,
Just started with UiPath.
I scraped 2 texts, which are number from website, wish to add up both number and then save to Excel. Can help?
Kim
Hi everyone,
Just started with UiPath.
I scraped 2 texts, which are number from website, wish to add up both number and then save to Excel. Can help?
Kim
@KimSanWu
welcome to community
scrapedDataTable) with the scraped data.Use an “Assign” activity to calculate the sum of the scraped numbers.
Assign: totalSum = scrapedDataTable.AsEnumerable().Sum(Function(row) Convert.ToDouble(row(“ColumnName”)))
Open the “Assign” activity and create a new variable totalSum.
Hi @KimSanWu ,
If you already have scrapped text then you can try below command in assign activity
Output = (CInt(text1)+CInt(text2)).ToString
If you would like to write all three to excel then
Build data table with three columns (value1,value2,output) and store it in dt_Output
Use add data row activity, give datatable as dt_Output and in array row parameter pass {text1,text2,Output}
Use write workbook range activity and write the datatable to excel - filepath, datatable and sheet name should be given as parameter
If you would like to write only the output to excel then
Thanks, will try it out!
may be late but will try to help you anyway =)
after getting those strings from your website you can use an assign activity and convert those value to int/double with:
var1 = Convert.ToInt32(yourVariable)
or
var1 = Convert.ToDouble(yourVariable)
(depends on what kind of type your scraped text´s are)
next you can write the sum into excel by using “Write Cell” or “Append Range” inside an “Use Excel File” Activity.
you can either say var1 + var2 or assign/create a new variable like varSum, if you plan to use the sum elsewhere for example.
Thank for the suggestion!
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.