Not working - any one help please
Can any one please provide the command,
the below command works wrong,
sed 's/.*getdate(),\(.*\),\(.*\),.*/\2/' < file
my txt file:
------------------------------------------
values('SGAV01204','retention_cd','retention_cd','C','EQUALS','N',-999, NULL,NULL,'N','N',NULL, NULL,'SYSTEM',getdate(),'0','D','0','S','N',0,'N','N','00',NULL1,NULL2,'N',NULL3,NULL4,NULL)
------------------------------------------
output for the above command:
by using above sed command (sed 's/.*getdate(),\(.*\),\(.*\),.*/\2/' file) i am getting below O/P:
O/P:
------------------------------------------
values('SGAV01204','retention_cd','retention_cd','C','EQUALS','N',-999, NULL,NULL,'N','N',NULL, NULL,'SYSTEM', NULL4
------------------------------------------
but expected output is just :
------------------------------------------
'D'
------------------------------------------
(2nd word after getdate() word)
Instead it printing from back side 2nd word also the first line.
can any one please give the sed command which provide the exact O/P i needed(only the second word after getdate() and NOT the first line). I dont need the first line also.