need a part of output data as output

HI Guys,

I need some expert help.. i have this below data as input

WHERE StartTime >= '2010-03-24 20:10:08'
AND username in('abc_xxx_yyy_01')

and output need is
just

in

appreciate your help on this !!!!

thanks you ...

Just in as output? Weird, but you can try this:

sed -n 's/.* \(in\)(.*/\1/p' file

Generally you'd use sed or awk to strip whatever you don't want. Something like

yourprog | sed 's/.* in//'

or

yourprog | sed 's/.* in/This is: /'

Try this also:

grep 'in' file | awk -F '(' '{print $1}' | awk '{print $3}'

Thank You ... can i use output in to a variable and then use in my if statement

Yes. Try this:

a=`grep 'in' 5.txt | awk -F '(' '{print $1}' | awk '{print $3}'`
echo $a

Thanks Guys !!! Suppose if i want to search for in( or in ( or in ( how to grep in one command with above sceniro...

Try this :

grep -e 'in(' -e 'in (' -e 'in ( '

---------- Post updated at 12:25 PM ---------- Previous update was at 12:24 PM ----------

grep -e 'in(' -e 'in (' -e 'in ( ' file

Thank You again !!! i may seek ur help again as i am totally new to unix :smiley: