What is your data?
(Sorry for any wrap-around. :) In general, "it doesn't work" is a very poor problem description.Win8 Strawberry 5.8.9.5 (32) Tue 10/13/2020 15:55:21 C:\@Work\Perl\monks\pragovnj >cat junque.txt foo bar CAST(CAST(hs_date AS DATE FORMAT 'YYYYMMDD') AS CHAR(08)) as h +s_date biz boz C:\@Work\Perl\monks\pragovnj >perl -p -i.bak -e "s/\QCAST(CAST(hs_date AS DATE FORMAT 'YYYYMMDD') A +S CHAR(08)) as hs_date\E/FORMAT_DATE(hs_date, 'YYYYMMDD') as hs_date/ +g;" junque.txt C:\@Work\Perl\monks\pragovnj >cat junque.txt foo bar FORMAT_DATE(hs_date, 'YYYYMMDD') as hs_date biz boz C:\@Work\Perl\monks\pragovnj >cat junque.txt.bak foo bar CAST(CAST(hs_date AS DATE FORMAT 'YYYYMMDD') AS CHAR(08)) as h +s_date biz boz
Update: Please see Short, Self-Contained, Correct Example for a discussion of good problem presentation practices.
Give a man a fish: <%-{-{-{-<
In reply to Re^4: replace string from Command Line (updated)
by AnomalousMonk
in thread replace string from Command Line
by pragovnj
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |