Generate DataTable

I am trying to generated data table by using tab as column separators. However, one of the value has 3 tabs in between, it was separated into 3 columns as below:


This 3 cells supposed to be in single cell but somehow it was separated by because of tab.
Full message should be: Car unable to be booted up 1:Car in garage 2:1: Car in servicing
CarId: APG1001 / APG1002

Replace multiple tabs with a single tab and then generate data table.

You can use Regex expression or string replace methods to replace the text.

Regex expression :

result = Regex.Replace(inputText, "\t{2,}", "\t")

Regards,
Karthik Byggari

2 Likes

image

Error occurred - One or more children have validation errors or warnings

you have to assign to the string. Not to data table.

1 Like

Doesn’t seems work:
image

Try the below regex expression -

Regex.Replace(yourString, "\t+", "\t")

1 Like

@KarthikByggari,

Same result as above.

Can you check if multiple tab spaces present or not.

Regards,
Karthik Byggari

2 Likes

I’m not sure what does that mean but here is my .txt and .xaml file
abc.txt (592 Bytes)
Main (1).xaml (10.1 KB)

I will check and then update you.

Regards,
Karthik Byggari

1 Like