Need to add csv data in a code sentence

Need to add csv data in a code sentence
i am using read csv actvity and i need use the result of this activity in an assign

Output Csv = RequeteDeposee

The code = Double.Parse(RequeteDeposee.ToString, System.Globalization.CultureInfo.CreateSpecificCulture(“fr-FR”)).ToString

but i have this error :

image

The output of Read CSV is a data table, not a string. So converting the datatable to string and then to double is the reason for the error.

Which part of the CSV are you looking to convert to double?

hi @Charbel1

I need to to convert a column with numbers (column B)

Okay, to do this:

  • Use a FOR EACH ROW

And assign your final variable to this:

outputDouble =  Double.Parse(row(1).ToString, System.Globalization.CultureInfo.CreateSpecificCulture(“fr-FR”))

Did you try the search?

1 Like

@Charbel1

I have an error
image


@J0ska
i don’t really understand how they do in the others topic, can you show me with my issue ?

Thank you

Can you send sample data please?

I can’t send you the file
image

Can you please use a log message “décimal.ToString” after assigning the decimal.

So we can know on which row we’re getting the error.

The video is quite self-explainable, isn’t?
You should use following expression in the invoke code:

dt.AsEnumerable().ToList().ForEach(Sub(row) row.SetField(“your_column_name”, Double.Parse(row(“your_column_name”), System.Globalization.CultureInfo.CreateSpecificCulture(“fr-FR”)).ToString)

Cheers

image

How many times are you going to post this same thing then ignore people’s replies? RequeteDeposee is a datatable. You can’t convert a datatable to a string.

@postwick

Can you show me how can i do it plz ?

I believe you received all the possible hints. You just need to use a bit creativity and assemple it in final solution.

Cheers

@J0ska
if I knew how to do it I wouldn’t be here asking for help, but if you don’t want to help me I can’t force you. I’m here to learn from everyone

Hi @Soudios,

If you need column B value in a string variable do the following :
1.Use filter data table activity, retain column and specify index as 1
2.use output data table activity to convert this data table to string

Let me know if this helps or if I took your query in a wrong way…

Happy to help, cheers,
Shivu

Its almost what i need :smiley: what i need is to use this code below and replace “RequeteDeposee” which is a data table in string because i can’t write this code like that ( i can’t convert data table to a string) as my friend @postwick said

The code = Double.Parse(RequeteDeposee.ToString, System.Globalization.CultureInfo.CreateSpecificCulture(“fr-FR”)).ToString

What do you want your output to be, where do you want to save it?

i need to put my csv file into this code
The code = Double.Parse(RequeteDeposee.ToString, System.Globalization.CultureInfo.CreateSpecificCulture(“fr-FR”)).ToString

to solve my question in this topic
strong textCopy csv file to excel with decimal problem after decimal point - #34 by Soudios