|
|||||||
| Forums | Search Forums | Register | Forum Rules | Man Pages | Albums | FAQ | Members | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
|
|
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
How to replace actual generated date with sysdate?
Hi, currently I've a file with the following content: Code:
insert into CD_CARD_TYP (code, description, last_update_by, last_update_date)
values ('024', '024', 2, to_date('29-03-2008 05:16:09', 'dd-mm-yyyy hh24:mi:ss'));
insert into CD_CARD_TYP (code, description, last_update_by, last_update_date)
values ('032', '032', 2, to_date('24-04-2008 05:17:30', 'dd-mm-yyyy hh24:mi:ss'));
insert into CD_CARD_TYP (code, description, last_update_by, last_update_date)
values ('034', '034', 2, to_date('24-04-2008 05:17:30', 'dd-mm-yyyy hh24:mi:ss'));I need to replace the date with SYSDATE, i.e. Code:
insert into CD_CARD_TYP (code, description, last_update_by, last_update_date)
values ('024', '024', 2, sysdate);
insert into CD_CARD_TYP (code, description, last_update_by, last_update_date)
values ('032', '032', 2, sysdate);
insert into CD_CARD_TYP (code, description, last_update_by, last_update_date)
values ('034', '034', 2, sysdate);how do I change the above? thanks a lot! |
| Sponsored Links | ||
|
|
#2
|
|||
|
|||
|
With sed: Code:
sed 's/to_date([^)]*)/sysdate/' filename |
| Sponsored Links | ||
|
![]() |
| Tags |
| shell bash ksh |
| Thread Tools | Search this Thread |
| Display Modes | |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Replace a pattern in a file with a generated number using sed or awk | vivek d r | Shell Programming and Scripting | 13 | 06-20-2012 10:06 AM |
| Need help in Shell Script comparing todays date with Yesterday date from Sysdate | kumarmsk1331 | Shell Programming and Scripting | 0 | 07-29-2011 04:49 PM |
| Open the file and replace the variable with actual value | bharathappriyan | Shell Programming and Scripting | 3 | 08-02-2010 02:01 PM |
| Need a script to Append date to generated .txt file | prince_of_focus | Shell Programming and Scripting | 2 | 08-01-2006 02:51 PM |
| How to FTP fiels according to generated date | maheshsri | Shell Programming and Scripting | 0 | 05-03-2006 02:06 PM |
|
|