Range into single column

I have a problem where I want to read a range like, A1:F1 and then write that data into column A only, so A1-A6.
I feel like it should be fairly easy to do but I have been scratching my head trying to solve this problem for longer that I care to admit.
If someone could please help and enlighten me, that would be great!

Data:

Result I want to achieve:

1 Like

Hi,

If you can use custom activity, there are some activity which support DataTable transpose.

If you cannot use custom activity, the following might helps you. It’s a sample for it with string manipulation.

Sample20200623-1.zip (22.3 KB)

Regards,

3 Likes

Thank you for the quick and helpful response.

I used the string manipulation example and it works like a charm!
If it is not too much to ask, how does it work and how can I learn more about it? Looking at System.Text.RegularExpressions.Regex.Replace(text,β€œ^.*\n”,β€œβ€).Replace(β€œ,”,vbcrlf) does not really say anything to me but I would like to learn more so I understand what is going on.

Once again, thank you so much

1 Like

Hi,

how does it work and how can I learn more about it?

Hope the following helps you.

OutputDataTable outputs the following string.

Column0,Column1,Column2,Column3,Column4,Column5
1,2,3,4,5,6

First, remove the first line using System.Text.RegularExpressions.Regex.Replace(text,"^.*\n","").

It will be as the following.

1,2,3,4,5,6

Then replace comma to linebreak using Replace(",",vbcrlf)

It will be as the following.

1
2
3
4
5
6

Finally, we can get datatable from the text as csv using GenrateDataTable.

Note: If data contains comma, we need choose another approach

Regards,

1 Like

Thank you once again for the quick and informative response.
It is still a bit confusing but I think I am catching on. The only thing I would like to know a bit more about is how and what Regex is used and knowing what symbols to use, but I may be able to find the material of that on my own.
Thank you for the explanation and help once again!

1 Like

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