Regex text


#1

please help me to get 80 is output from the below text

[oracle@a9tvdb101]:/home/oracle:>> cle | awk ‘{print $2}’ <
80.00
[oracle@a9tvdb101]:/home/oracle:>>

Output should be 80

Raj


#2

You can try this regular expression: (?<=\ <)(.*)(?=\ .)
//remove spaces


#3

i tried but getting
nothing


#4

Not sure if it’ll help but maybe delete the lines in the string before you search for the text?

VARIABLE.Replace(Environment.NewLine," ")


#5

@rajsekhar attached file is working please check it

Main.xaml (7.7 KB)


#6

Replace new line with space and try again


#7

thanks for your help indra.

some times digits may be more or less also , it is not constant like 80


#8

hi palindrome, i tried replacing lines and spaces also , giving null value


#9

Can you share two or three example of the formats


#10

[oracle@a9tvdb101]:/home/oracle:>> df -g | grep /u01/oradata | awk ‘{print $2}’ <
120.00
[oracle@a9tvdb101]:/home/oracle:>>

[oracle@a9tvdb101]:/home/oracle:>> df -g | grep /u01/oradata | awk ‘{print $2}’
4.00
[oracle@a9tvdb101]:/home/oracle:>>

please find the above formates for your reference


#11

Can you clarify this string {print $2}’ < will be common in all the strings?


#12

yes, it is same for all strings