split

akhunt

New Member
split each line in such away that all alphabets should come in first column and number should be in second column
e.g AA 1234
 

akhunt

New Member
Hi,
The input is alphanumeric like AA123, 123AA , AC123BC but it will split such a way that alphabet will come in one column and number will come in different column . The result should be like AA 123, ACBC 123 and it should not be hard coded.
 

Sachin_Kharmale

Active Member
Hi Akhnunt,

If you want split data as per your requirement So you can do this with the help of blue prism code stage.
we required input data which is text like AC123BC as a input and you will get separated data in the blue prism collection.
just follow the bellow steps..

1. Take Code stage in object and set object code language as c# and Design flow like bellow screen shot.
Input-InputData and output will be - CollectionsofAlphabates
View attachment 1576474596148.png
2. Write bellow c# code in your code stage.


C#:
            DataTable outputColl = new DataTable("AlphaNumber");
            outputColl.Columns.Add(new DataColumn("Alphabates", typeof(String)));
            outputColl.Columns.Add(new DataColumn("Numbers", typeof(String)));
            StringBuilder Alpha = new StringBuilder();
            StringBuilder Numbers = new StringBuilder();

            foreach (char c in InputData.ToCharArray()) {

                if (Char.IsDigit(c))
                {
                    Numbers.Append(""+c);
                } else
                {

                    Alpha.Append("" + c);
                }
            
            }
            DataRow row = outputColl.NewRow();
            row["Alphabates"] = Alpha;
            row["Numbers"] = Numbers;
            outputColl.Rows.Add(row);
            CollectionAlphabates=outputColl;
View attachment 1576474642818.png
3. Gives your input and execute flow you will get output in Blue Prism Collection collection.
View attachment 1576474723913.png
I hope it will help you..!
 
Top