How to convert string into an array

My application is generating a report which i export into *.txt file which is tab delimited. I can read this file as string but what i want to do is, to convert this string data into an array which will be split by tab. Beacuse i need the value of specific index all the time and content of the file is always going to be the same but the value will be dynamic. Please help me achieve this.

1 Like

@Inzmamul_Haq

Use String.Split method and provide delimiter and then it will convert given string into Array of string.

                                arrStr []  = inputStr.Split("delimiter"c)
7 Likes

May i know what is c in this?

C is for character

1 Like

If you wanted to split by tab , Hope below one helps you

Str = str.split(“\t”.ToCharArray)

1 Like

@Inzmamul_Haq - you can try to use the split function like below -

strStringData.Split(new Char[] { ' ', '\t' }, StringSplitOptions.RemoveEmptyEntries);

Untitled
How can i fix this?

Check this workflow,
SampleSequence.xaml (5.7 KB)

5 Likes

@Inzmamul_Haq

1 - On the assign part, ACD should be an array.
2 - On the message box part, to display the content of an array use a for each loop, to iterate on all the contents of that variable.

1 Like

But i do not need all the values only value of specific index, i need

@Inzmamul_Haq

Ok, than do this “ACD(0).ToString” to get the first data.

1 Like

@Inzmamul_Haq

Can you share you file, your workflow and exactly what you want to get ? PLEASE BE AWARE OF PRIVACY, USE JUST RANDOM DATA !

yes, that is random data. Application generates this data in table format. May that is why it is showing like this. So is there a way i can find the value from the tables format?

@Inzmamul_Haq

I can’t tell, i need to see the data that you want to get the index from, because on your first request you asked to get the data by tab and looks like didn’t work as wanted…

Hi @Inzmamul_Haq,

Try to use the read csv activity. It will give you the data in the file as a datatable.

Regards,
Nithin

Could you please give me a sample of doing this? It will be helpful

(post withdrawn by author, will be automatically deleted in 24 hours unless flagged)

I do not understand this message. I am asking if you have any sample of it, it will help me a lot and others as well :slight_smile:

1 Like

Use DataScraping… Better for your issue!

2 Likes

It is indeed… Thank you…cheers

1 Like