How to Achieve Multiple Column Separators in Generate Data Table?

Hey,
An example of string that I would pass is
“ASCDF,SWE_DSWE_345_32_SDER+DFC_ERDS_456_32_S3DFG”

I need to separate this into different columns based on the “,” , “_” and “+”

I am using the Generate Data Table Activity but only able to provide one column separator.

Please advise on how I would be able to send multiple column separators or any other activity I can use that separates text file text into excel columns based on 3 different symbols.

Thank you

Hi @Meyammai,

You can try by replacing the other 2 delimiter into another first, then separate them.

Use Multiple Assign activity:

Test = Test.Replace("_",",") This will replace _ with ,
Test = Test.Replace("+",",") This will replace + with ,

Now you will left with string like

“ASCDF,SWE,DSWE,345,32,SDER,DFC,ERDS,456,32,S3DFG”

and able to split them by using “,”

Regards,
Kah Liang

The “Test” here is referred to which variable?
Attached Screenshot for better understanding of the error.

“Test” is the string to store “ASCDF,SWE_DSWE_345_32_SDER+DFC_ERDS_456_32_S3DFG”

1 Like

Yes, Test refers to the string variable contains “ASCDF,SWE_DSWE_345_32_SDER+DFC_ERDS_456_32_S3DFG”

In your case from the screenshot I see, you will need to create a variable in Read Text File Output panel to store the string retrieved - Let’s say “Test”

Then use assign mentioned above to replace both “_” and “+” with “,”

Regards,
Kah Liang

1 Like

Thank you! It is working as expected

Have a great day!

@Kah_Liang @Eric_Wong_Test

No worries, you too have a great day!

Regards,
Kah Liang

1 Like

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