r*u 发帖数: 63 | 1 Is the ^M in unix files the "enter" in windows files? Any easy way to
get them out? Many thanks. |
r*u 发帖数: 63 | 2 I got it.
in VI use the command :%s/^V^M//g
in unixshell sed 's/^V^M//g'foo > foo.new
where ^V^M means control+v then control+M.
【在 r*u 的大作中提到】 : Is the ^M in unix files the "enter" in windows files? Any easy way to : get them out? Many thanks.
|
l****g 发帖数: 21 | 3 u don't need the /g part, 'coz there will be only one ^M per line, otherwise
you got a problem.
【在 r*u 的大作中提到】 : I got it. : in VI use the command :%s/^V^M//g : in unixshell sed 's/^V^M//g'foo > foo.new : where ^V^M means control+v then control+M.
|
r*u 发帖数: 63 | 4 I'm not sure what this g means here. But it seems ok. Could you tell me
what the problem would be? thanks.
【在 l****g 的大作中提到】 : u don't need the /g part, 'coz there will be only one ^M per line, otherwise : you got a problem.
|
c**v 发帖数: 103 | 5 dos2unix
【在 r*u 的大作中提到】 : I'm not sure what this g means here. But it seems ok. Could you tell me : what the problem would be? thanks.
|
G**T 发帖数: 388 | 6 dos2unix, unix2dos
【在 l****g 的大作中提到】 : u don't need the /g part, 'coz there will be only one ^M per line, otherwise : you got a problem.
|
r**m 发帖数: 13 | 7 dos2unix: Command not found.
how can I do?
【在 G**T 的大作中提到】 : dos2unix, unix2dos
|
d*******n 发帖数: 9 | 8 vi, :%s/^v^m//g
【在 r**m 的大作中提到】 : dos2unix: Command not found. : how can I do?
|
l******t 发帖数: 8 | 9 dos2unix.pl xxx.dos > xxx.unix
The following is the perl file. Don't forget to make it executable.
#!/usr/bin/perl
while(<>){
if($_ =~ /(.*)\r/)
{
print($1, "\n");
}
else
{
print($_);
}
}
【在 d*******n 的大作中提到】 : vi, :%s/^v^m//g
|