How to convert row of Excel to string?

Hello,

I have a table of Excel
For example:
|A|D|D|B|A|
|H|C|A|C|J|
|G|H|A|V|X|

How to convert it to string, like as “ADDBA”,“HCACJ”,“GHAVX”?
Thank you.

Hello @Bosch ,

Here what you can do is :
1)Read the excel using Read Range activity, then you will get a Datatable.
2)Use Output Datatable activity to convert that to string.

3)Then use yourString.Split(Environment.NewLine.TocharArray). to convert that a string array.

4)you can use a foreach loop to get each value or using the index you can get the values as per your requirement.

assign Activity
LHS: ListRowVals | List(of String)
RHS:
dtData.AsEnumerable.Select(Function (x) String.Join(“”,x.ItemArray).toList

Now we got a list which each item represent the row colum values

This we can flatten again with:
String.Join(“,”,ListRowVals) or any other customized Joined String representation

Thanks for the speedy response!

thank you for all the help

Hi @Bosch

  1. Read the excel file using read range.
  2. Output datatable to get text
  3. Later write text file activity to output the text obtained at step 2 by passing the filename as name.txt
  4. Replace all commas with nospace.

This is also a method!thank you~

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