Hi Team ,
I have a data in data table (Dt).
Need to replace the particular column data (Total order quantity).
1,325.00 ----Value in Excel
1.325.00-----required .
Can some one please help on this .
Regards ,
Suresh.
Example:-
Hi Team ,
I have a data in data table (Dt).
Need to replace the particular column data (Total order quantity).
1,325.00 ----Value in Excel
1.325.00-----required .
Can some one please help on this .
Regards ,
Suresh.
Example:-
Please try below steps,
dt.asenumerable.tolist.foreach(sub(row) row(“Total order quantity”)= row(“Total order quantity”).tostring.replace(“,”,“.”))
Write the datatable back into the excel using write range activity.
We have to use this inside invoke code as it does not produce a output.
Hope this helps.
Thanks
Please find the Linq Query
ReplaceColumn.zip (2.7 KB)
Please provide as solution if your condition is been met
Hello @Thumu_Suresh , Try this method.
Read Excel File and store in a variable , For Example InputDT.
Using for each data table, Loop the proccess.
Use assign activity
CurrentRow("Total order quantity")=System.Text.RegularExpressions.Regex.Replace(CurrentRow("Total order quantity").to string,",",".")
Finally write the data in another sheet or same sheets.
Now data will change in certain column.
Happy Automation
Regards,
Gokul Jai
Hi @Thumu_Suresh ,
kindly find below mothered.
read Excel (dtTest)
create new dt (Result)
and user below execration
(From row In dtTest
Select Result.Rows.Add({row(“No”).tostring,row(“Name”).tostring.replace(“a”,“”),row(“E_Code”).tostring,row(“Proj”).tostring,row(“Dec”).tostring,row(“Status”).tostring,row(“Count”).tostring})).copytodatatable
thanks,
RajKumar
Hi Jayakumar,
While reading the excel in data table can’t see the data with “,” but in same position i have to replace with “.”.
But in excel data it has “,”.
Need help on this.
@RajKumarDuraiFAS
Regards ,
Suresh .T
Did you read the file using Workbook activity? then try using excel application scope and excel read range and enable the preserve format option in the read range property panel
Hi Fasil ,
I tried with your approach while using excel scope and excel read range in data table it is showing has below .
Data is in double code while converting into CSV file or edit with notepad it is show in double code but we don’t need that double code “” .
“2,686.000”
we need remove the “,” and replace with “.” and “.” should be replaced with “,”.
EX:-2,686.000 ---->2.686,000
I have used below code it was working for only one column .
How we can use it for multiple column .
can you please help on that fasil.
dt.asenumerable.tolist.foreach(sub(row) row(“Total order quantity”)= row(“Total order quantity”).tostring.replace(“,”,“.”))
Thanks,
Suresh.T