
ichi
User
Jul 9, 2009, 1:49 AM
Post #3 of 5
(8602 views)
|
Re: [bugman] regex - skip sub-section ?
[In reply to]
|
Can't Post
|
|
while (<>) { chomp; @f = split(/\"/, $_); for ($i = 0; $i <= $#f; $i += 2) { $f[$i] =~ s/,/./g; } print join("",@f); } output
# more file bla bla, bla "bla1, bla1" , sdf sdfs,fdf, dsff, "xxxx,xxx,yyy,zzz" ,dff # ./test.pl file bla bla. bla bla1, bla1 . sdf sdfs.fdf. dsff. xxxx,xxx,yyy,zzz .dff is this what you want? i know the output doesn't have the " anymore, but its easy to put it back. so i leave it to you.
|