我想将;
替换为TERMINATED BY '\034' STORED AS TEXTFILE;
我正在使用sed
命令,但\0
替换;
sed "s|;|TERMINATED BY '\034' STORED AS TEXTFILE|"
我试过了\\034
,但它没有用。
答案 0 :(得分:0)
使用此sed
:
sed "s|;|TERMINATED BY '\\\034' STORED AS TEXTFILE|"
答案 1 :(得分:0)
如果perl
解决方案没问题,q operator在这种情况下很有帮助
$ echo 'abc ; xyz' | perl -pe "s/;/q(TERMINATED BY '\034' STORED AS TEXTFILE)/e"
abc TERMINATED BY '\034' STORED AS TEXTFILE xyz