use v6; my regex fields { \" <( .*? )> \" | <-[,"]>* } my $input = open 'input.csv', :r; my $output = open 'output.tff', :w; for $input.lines { next unless /* % ','/; $output.print: @.join(chr 31) ~ chr 30; } $output.close; #### my regex fields { \" <( .*? )> \" | <-[,"]>* } lines open 'input.csv' ==> map({@.join(chr 31) ~ chr 30 if /* % ','/}) ==> spurt('output.tff');