I have to copy a list of line items from SAP like below up to 36 rows, I need to split this into 15 -15 rows as It is accepting only 15 values at a time.
10
20
30
40
50 and so on…
I am copying this data using ctrl+C and getting the data from clipboard and created a data table using generate data table. While pasting the data in SAP I am getting values like
Column1
10
20
30
40
I am not able to remove “Column1” from this .
Can anybody please help me ? As I am stuck with this.
@atishaarav Could You Provide the String Data in a Text file ? Or You Could Debug the Workflow and Show us the Value of the DT_Text before and after the Split in the immediate Panel ?
I am able to remove column1 using above expression and getting appropriate value in string format.
But My challenge is I have to copy first 15 rows and paste into SAP.
So for this again I have converted the string(DT_Tex) into DT using generate Datatable.
and used “Set to clipboard” for pasting data. Still it is pasting like attached image.
We could Prepare a List of 15 Data each, Meaning 15 values Separated by NewLine as one item in the Array.
The Input :
The Output :
The Expression used :
setList = (From i In Enumerable.Range(0,CInt(Math.Ceiling(CDbl((Split(extractedText,Environment.NewLine).Count-1)/15)))+1)
Let val = String.Join(Environment.NewLine,Split(extractedText.Trim(Environment.NewLine.ToCharArray),Environment.NewLine).Skip(1).Skip(i*15).Take(15).ToArray)
Select val).Where(Function(x)x.Count>0).ToArray
where setList is a variable of Type String Array, and extractedText is the Input Text.
Now using the setList we can Loop Through with For Each and Add only 15 Data each time.