How do I change this column into Int after data scraping

Im trying to change it to Int so that I can sort it base on the amount of reviews there are, but it cant let me sort due to this

@Lee4216

if you want to do it in the excel You can use format cells activity

Sorry, I do not have the format cells activity. If that activity needs to be installed inside the studio i cant due to reasons.

Hi

You can use Excel Activity

1 - Use Excel File

2 - Format Cells

3 - Text to Columns (this one is to update the entire column to the new format type, so you can’t need to do individually)

don’t use delimiter to prevent splitting text in columns

Could you share the project dependencies?

@Lee4216

after datascarping before writing it excel

dt.AsEnumerable.where(function(a) cint(a(1).ToString)<>0).CopyToDataTable

so that all the values will be converted to integer and you can sort it

I tried running the code but another error came up.
Error:
Assign: Conversion from string “$34
.
99” to type ‘Integer’ is not valid.


Im not sure if this is the issue but when collecting data, the price change to this kind of format with break lines which is the issue.

You have more columns now

Change this part of expression

a(1).ToString to a(2).ToString

Where 1 and 2 in the column index starting from 0 (first column)

Now the ratings is getting in way :sweat_smile:
Error:
Assign: Conversion from string “4.5 out of 5 stars” to type ‘Integer’ is not valid.

Sorry, the Reviews column is your 4th column, so change a(1).ToString to a(3).ToString

I did that, It was only able to get rid of the first 1 but it still have the exclamation mark when i click it.
image

Alright

Coud you attach the excel file ?

Filtered.xlsx (40.7 KB)
Here

@Lee4216

From where are you getting the data?

Are you using write range workvook to write the data?

Please try with it

Cheers

Yes, I am using Write Range Workbook

@Lee4216

Try to add a new column to the datatable with datatype as int32 and tehn add the data from column 4 to 5 using the below and check

Use invoke code and pass dt as in/out argument

Dt.AsEnumerable.ToList.ForEach(Sub(r) r(4) = Cint(r(3).ToString))

After this delete column 4 using index as 3 in remove data column

And then write the data to excel and check

Cheers