Read CSV number and write that number to XLS

Hi,

I am reading from CSV number value encoded “windows-1250” and later
writing that number value to XLS file.

The problem is, the number is written to XLS file as a string and not in number format.

image

How to write number in number format to XLS file?

Thx for any suggestions.

Kind regards, Vanja

HI @VanjaV

After written the Data in the xls file you can try with Format cell activity and check the format of the row

Regards
Gokul

Hi,

If you’re using WriteRangeWorkbook, can you try to use UseExcelFile and WriteDataTabletoExcel activity?

If Excel is not installed in your machine, can you try to store data as Int32 in DataTable? (Column type should be Int32 or object etc) WriteRangeWorkbook will work.

Regards,

Hi @Yoichi

I am trying this:

but get the following error:

“Assign: Conversion from string “4.133,97” to type ‘Integer’ is not valid.”

Kind Regards, Vanja

Hi @VanjaV

Change the variable type of the viAmount to Int32

Hi,

It already is:

image

that is why prefix “vi” → variable integer

the other is with prefix “vc” → variable character

KR Vanja

Hi,

Probably I got your situation.
Can you try to use the following expression at Value property of the WriteCell activity?

Double.Parse(vcAmount,System.Globalization.NumberStyles.Any,New System.Globalization.CultureInfo("es-ES")).ToString()

image

Regards,

1 Like

Hi @VanjaV

Can you try with Cdbl instead of Cint

@Yoichi

It works! :slight_smile:

image

image

Thanks!

1 Like

Hi @Gokul001

It gives this error:

Assign: Conversion from string “4.133,97” to type ‘Double’ is not valid.

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