Hello All,
I want to create a datatable from string. so, I am using Generate Datatable activity.
In Generate Datatable activity, I want to use 5 spaces as a column seperator. How can I do that?
Please help me!
Thanks in advance
Hello All,
I want to create a datatable from string. so, I am using Generate Datatable activity.
In Generate Datatable activity, I want to use 5 spaces as a column seperator. How can I do that?
Please help me!
Thanks in advance
@pradnyajadhav0712
Very likely you file is separated by “Tabs” and you could simply try replacing them with semicolumn like:
inputString.Replace(vbTab,“;”)
If not, you could replace “more than one space” by “One space”. You can do it with the Replace Activity with the Pattern “\s+” ==> “”
Sequence
Generate Data Table
Properties:
Column Delimiter: Set to a character that is not present in your data, e.g., “~”
Assign
To: YourDataTable.Columns(0).ColumnName
Value: YourDataTable.Columns(0).ColumnName.Replace(“~”, " “)
Assign
To: YourDataTable.Columns(1).ColumnName
Value: YourDataTable.Columns(1).ColumnName.Replace(”~", " ")
or
YourDataTable.Columns.Cast(Of DataColumn)().Select(Function(column) column.ColumnName = column.ColumnName.Replace("~", " ")).ToList()
cheers…!
Will be great if you can share the data.
YourTextVariable.Replace(" ", “,”)
You can replace the 5 space with comma & create the table with column separate as comma in the generate table.
In Generate Data Table Activity - Data Formatting Options - Use 5 Spaces in Column Seperator and try it