Trimming $ when scraping from website to datatable to excel

Hi, i am data scraping a website to datatable that goes to excel then i want it to do add the total amount. this issue is, it does not like the $ sign. this is the only issue i have, what is the easiest way to trim the $ automatically when the new column is being created on the spreadsheet?

Hi @katherine.a.lyons6.civ

Use this in for each row in datatable activity

row("Total Amount") = Convert.ToDecimal(row("Total Amount").ToString().Replace("$", "").Trim())

Regards,

@katherine.a.lyons6.civ


In the Extraction choose Number,This is the sample,i don’t have the sample website to show you the proper extraction

As you can see from your example, the $ will cause an error. You can’t convert “$1.23” into a number.

- For Each Row in Data Table
-- Assign CurrentRow("Price") = CurrentRow("Price").Replace("$","")

That’s it. Easy and done. Just replace Price with whatever your column name is.

i used the for each row, then i used the assign activity and put totalamount = the above expression but i am getting an error. it does not like the expression

@katherine.a.lyons6.civ

You have to do like below

CurrentRow("Total Amount") = Convert.ToDecimal(CurrentRow("Total Amount").ToString().Replace("$", "").Trim())

Can you show the screenshot how you are trying

Regards,

@katherine.a.lyons6.civ just do this, it’s simple.

@katherine.a.lyons6.civ,

Have you tried changing the datatype of the column in extraction wizard?

Thanks,
Ashok :slightly_smiling_face:

Hie @katherine.a.lyons6.civ there is multiple way to remove $ from your excel row data
1- when you use scrapping toot there is a option in that wizard that hold number value so when you apply this it will remove the $ from all the records
2- method you can use replace manipulation to remove $ from your row data
Cheers Happy Automation…