我有一個包含這一行的文件。正則表達式^ A和^ S?不能夠sed或grep嗎?
輸入
sls="N" stnid="armID"
sls="N" stnid="C-ARM #11 w^Aw^Aw^A^Sg^Aw"
sls="N" stnid="virtualID"
對於我其中我要像
sls="N" stnid="armID"
sls="N" stnid=""
sls="N" stnid="virtualID"
欲sed的 「C-ARM#11瓦特^胡^胡^ A^SG ^胡」 的輸出和用空白替換它。
問題是沒有正則表達式,我可以找到它將取代它。
我試過sed -e s //^// g s/A // g myfile> newfile。
它沒有工作。
還有一個問題是,當我CAT我的文件,它不顯示我的^ A &^S字符。 文件看起來像這樣。
sls="N" stnid="armID"
sls="N" stnid="C-ARM #11 wwwgw"
sls="N" stnid="virtualID"
請幫助,在此先感謝。
Pal
如果你沒有看到他們時,你'cat'文件,它們是'control-A'字符,而不是'^'後面是'A'。 – Barmar 2013-04-08 18:44:53