While converting excel to text document we getting output file with out comma Is there any other way to convert excel to text document without comma.
- Read Excel Data:
- Use “Excel Application Scope” activity.
- Inside it, use “Read Range” activity to read data from Excel into a DataTable (e.g.,
dtExcelData
).
- Format Data:
- Use “For Each Row” activity to iterate through each row in
dtExcelData
. - Inside the loop, use an “Assign” activity to modify the column value without commas. Example:
row("ColumnName") = row("ColumnName").ToString().Replace(",", "")
.
- Write to Text File:
- Use “Write Text File” activity.
- Provide the path and filename for the text file.
- In the “Text” property, use
String.Join(Environment.NewLine, dtExcelData.AsEnumerable().Select(Function(row) String.Join(vbTab, row.ItemArray)))
to format the data with tabs and new lines.
- Read Excel File using Read Range Activity
Assign Variable DT as Datatable
Then try below expression
MyDelimiter: You can use any Delimiter like Comma (“,”), Colon(“:”), Space(" ") etc. according to your requirement.
String.Join(Environment.NewLine, DT.AsEnumerable().Select(Function(row) String.Join(“MyDelimiter”, row.ItemArray)))
Hope it will helps you
Cheers!!
- Read range activty and read excel into dt datatable
2 output datatable activity and convert datatable to strinng - Write the string to text file using write to text
Cheers