I have a file containing strings such as:
UPDATE PS_CA_BI_FF2_TA3 SET DELETE_ME = 'Y' WHERE PROCESS_INSTANCE
BI.LAST_UPDATE_DTTM FROM PS_CA_BP_LINES LINE, PS_INTFC_BI BI WHERE
EXISTS ( SELECT 'X' FROM PS_CA_BILL_PLAN BP WHERE BP.CONTRACT_NUM
[SIZE=2][FONT=r_ansi][SIZE=1]%Select(COUNTER4) SELECT COUNT(*) FROM PS_INTFC_BI WHERE INTFC_ID
I'm trying to extract all the words begining with " PS_" from the lines and only the words. The results should look like
PS_CA_BI_FF2_TA3
PS_CA_BP_LINES
PS_INTFC_BI
PS_CA_BILL_PLAN
PS_INTFC_BI
I'm using the sed command:
[/SIZE][/SIZE][/FONT]
sed -n 's/.*\([Pp][Ss]_.*\).*/\1/p' x.x
[SIZE=2][FONT=r_ansi][SIZE=1] (x.x = filename containing these strings) but I keep getting the results that look like the following:
PS_CA_BI_FF2_TA3 SET DELETE_ME = 'Y' WHERE PROCESS_INSTANCE
PS_CA_BP_LINES LINE, PS_INTFC_BI BI WHERE
PS_INTFC_BI BI WHERE
PS_CA_BILL_PLAN BP WHERE BP.CONTRACT_NUM
PS_INTFC_BI WHERE INTFC_ID
How do I stop the extract to the end of the word or space after the word? Any suggestions would be appreciated.
[/SIZE][/SIZE][/FONT]