How to Remove quotes (‘) from the Total Data Table and write in excel

Hi,
i have an Excel-1 file it contains More than 30 column. i want Remove quotes (‘) from the Whole Data Table and write into excel.

Exp–

Input Below

Transaction_Date Updated_Date Transaction_Type
‘2022-03-20 15:35:15’ ‘2022-03-20 15:36:08’ ‘ACQUIRING’
‘2022-03-20 15:28:47’ ‘2022-03-20 15:29:21’ ‘ACQUIRING’

Output like below

Transaction_Date Updated_Date Transaction_Type
2022-03-20 15:35:15 2022-03-20 15:36:08 ACQUIRING
2022-03-20 15:35:15 2022-03-20 15:36:08 ACQUIRING

Hi @Anand_Designer ,

You could Try the Following Steps :

  1. Assuming you have read the Excel Sheet as Datatable, we make a Clone of that Datatable like below :
OutputDT = InputDT.Clone

Where OutputDT and DT are variables of Type Datatable

  1. Next, we use a Linq Query to Remove the Quotes at the beginning and Populate the Output Datatable using Assign Activity Below :
OutputDT = (From r In InputDT.AsEnumerable
Let ra = r.ItemArray.Select(Function(x)x.ToString.Trim("'")).ToArray
Select OutputDT.Rows.Add(ra)).CopyToDataTable()
  1. We then Write the OutputDT to the Excel using Write Range Activity.
1 Like

It showing Error Like Below

@Anand_Designer ,

Apologies,

Check the Updated Below :

OutputDT = (From r In InputDT.AsEnumerable
Let ra = r.ItemArray.Select(Function(x)x.ToString.Trim("'".ToCharArray)).ToArray
Select OutputDT.Rows.Add(ra)).CopyToDataTable()

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