How to put end of length to another text

sd.xaml (8.5 KB)
Above is my proj. In it, I am trying to get text ‘A’ text position and output the rest of words after the ‘A’. However, in extract.Substring(extractPos + “810589-AAB”.Length), it gets like 100 words after it, Thus, I want to set another text as B and get all the words in between A and B. How can I go about it?

@sangasangasanga
Try to use Split activity.
extract.tostring.split("-"c).Last
You will get “AAB”

Hi maybe I wasn’t very clear with my question.
For example below is my extract text. I want to get the words in between from the first text “S10589-AAB” to another text “Weekly/Monthly File”. But when i do .Length it just gives me all the text following. I only want till another text. How can i go about it?

O S10589-AAB Apple Innc
Ge (asda, 4 vCU 8) 01 Jun 2018to 30 Jun 2018 1,094.74
Ge Storage (SADADTDAFRA, 5DFeAW0DAC0GB) S1agaerg89-AAB-AAC 01 Jun 2018to 30 Jun 2018 121.06
Ge (SDFAADFTA, 5ADFCADFGAFB) S1589-afsr 01 Jun 2018to 30 Jun 2018 13.16
Ge (0arwgragaeg8R2 EE) 01 Jun 2018to 30 Jun 2018 57.90
Ge (MicrosoftWarwgragrS) 01 Jun 2018to 30 Jun 2018 0.00
Ge NSS2 Sn 2018 299.80
PPRDEFwfRFWRFWEBO1
G NSS4 Web SVJun 2018 06
PPRDWEBO1
G B Backup (Weekly/Monthly File) J

@sangasangasanga try below command. It will give u required output

var.Split({“S10589-AAB”,“Weekly/Monthly File”},StringSplitOptions.None)(1)

1 Like

Hi it works thanks but however, instead of returning 10 lines, It only return like 2 or 3 lines at the top even though the ‘(Weekly/Monthly File)’ text is below

@sangasangasanga u can split the string wrt newline and then u can write required number of lines anywhere u want.

Oh i see. How do you split the string by newline. Is it like split.(" ")

@sangasangasanga use any of the methods for splitting text wrt newline

Urvariable.split({Environment.Newline},StringSplitOptions.None)

Or

Split(Urvariable, Environment.Newline)

Hi,
You can use regular expression to using space count.
Regards
Bagish ojha

@Manjuts90 Hey I tried implementing youways not working exactly how i want it to be
1)
s = extract.Split({“10589-AAB”,“G BR1 Data Backup (Weekly/Monthly File)”},StringSplitOptions.None)(1)
lack of lines
2)
pos = extract.IndexOf(“G-Cloud S10589-AAB”)
txt = extract.substring(pos + "G-Cloud S10589-AAB).length)
txt2 = txt.split({Environment.Newline},StringSplitOptions.None)
txt2.toString - message box
not sure as output is System.string

@bagishojha Hi, how may I go about doing that?

@sangasangasanga In your example txt2 is array, u can’t display array like string.

@Manjuts90 Any other ways for me to double check the array?

@sangasangasanga

I didn’t get you?

I am trying to split by the new lines then limit it to 12 lines only. I want to display it to make sure it is correct
@Manjuts90

@sangasangasanga if u want to display the lines use loop.

firstly use a array string

yourstring.tostring.environment.newline
then
store your string into a array string variable
then
use that variable and start a loop

for
{
start to end string

then
manipulate your string
using regular expression and split with environment.newline

}

Regards
Bagish

@Manjuts90 @bagishojha

I want to find the text “S10589-AAB” and get the following texts till “total for s10589-AAB”. which is about 12 lines. However, as the output only returns 3 random lines from there. I want to specify to get the first text that matches the text.
I attached my codes and pdf file so maybe it is easier for yall to get what i am saying.

sd.xaml (17.6 KB)

can you show me this by converting into a text file

thanks
bagish

@bagishojha i added some random characters to conceal certain parts
$10589
NO S10589-AAB
G (MAZavwjebWke) 01 Jun 2018to 30 Jun 2018 1,36094.74
G tor (arwbtehbenB) S10AAC 01 Jun 2018to 30 Jun 2018 1346221.06
G (TNBGEDN) S1AAB 01 Jun 2018to 30 Jun 2018 132463.16
G 8SNDGNHDN hdmzaetaR2 EE) 01 Jun 2018to 30 Jun 2018 53467.90
G MiczghsrhtrosohsftWizgdhzdhndows HS) 01 Jun 2018to 30 Jun 2018 0.00
G NSfhzdgbgdbgnmin Svc (95%) (1 its) 01 Jun 2018to 30 Jun 2018 234599.80
PPRDWEBO1
G N4 Wfdhbhzdhfzfdgdmin Svc (99.5%) (1 Units) 01 Jun 2018to 30 Jun 2018 253452.06
PPRDWEBO1
G (Weekly/Monthly File) Jun 2018 124 GB(s) 1034525.40
G (Daily File) Jun 2018 119 GB(s) 1032451.15