What is the Regex for extract the total row?

I want to extract the data for each row , that data which come from the sap and it is copied by clipboard from there using regex expression need to extract the each row?
earlier i give (^|\d+|*\n) this expression now its not working.
Any knows help me .

thanks

@Gopi_Krishna_Reddy1

Can you show a sample input and output

cheers

Hi @Gopi_Krishna_Reddy1,

you can use Split option as well

stTest.Split(Environment.NewLine.ToCharArray).Count

Input
image

Output
image

if you want count use below

Thanks,

or else need regex use below workflow

^([^,]*),

image

@Gopi_Krishna_Reddy1

As @RajKumar_DC mentioned splitting on newline character should do the job

str.Split({Environment.Newline,"\r\n","\n"},StringSplitOptions.RemoveEmptyEntries)

cheers

@Anil_G i want to remove the first three rows also , index 0 to 2
like doted line , tittle and doted line.

@Gopi_Krishna_Reddy1

Then from the array variable which is extracted use array.Skip(3) this will skill the first 3 rows are give the next array

str.Split({Environment.Newline,"\r\n","\n"},StringSplitOptions.RemoveEmptyEntries).Skip(3)

cheers

image

@Anil_G it showing error.

@Gopi_Krishna_Reddy1 If getting total number of rows is the primary requirement, try to get it from SAP instead of string manipulations else, try to replace | symbol with , symbol and create CSV file. Once you have CSV, there are endless possibilities.

Happy Automation!,
Ashok

@Gopi_Krishna_Reddy1

if you are trying to save as array then use .ToArray() at the end.That would solve the error

Skip outputs a IEnumerable type which is a generic type …if you need array then cast it accordingly

Hope this helps

cheers

@Anil_G sorry i didn’t get ur point

@Gopi_Krishna_Reddy1

Please use like this

str.Split({Environment.Newline,"\r\n","\n"},StringSplitOptions.RemoveEmptyEntries).Skip(3).ToArray()

This will split the data on new line then remove the first 3 values and produce an array of remaining items

cheers