2014-09-05 60 views
-2

卸下文件中的一些垃圾字符我在UNIX文件有以下內容 -在UNIX

[email protected]; [email protected]; [email protected]; [email protected]; Sambitx1xsambit_das01 @ infosys.com; [email protected]

我想刪除PATTERN [email protected];從上面給出的地址。

有人可以幫助我如何使用sed或在UNIX中刪除它們?

+2

這個問題似乎是題外話,因爲它不是關於編程。 – sashoalm 2014-09-05 09:06:11

+0

這個問題似乎是脫離主題,因爲它屬於'unix.stackexchange.com'! – 2014-09-05 09:12:18

回答

0

是perl und不是秒,但我認爲它會幫助你。

#!/usr/bin/perl 

open $OUT '>', 'mail.txt' or die'Cant open file'; 

$str = <your_Str>; 

@mails = split /;/,$str; 

while(pop @mails){ 
    print $OUT $_; 
} 

close($OUT);