Subject="apply multiple regex to each line"

hi out there,
i wanted to $subject of a file. For a single regex, i used perl (ok, that's my fault):
perl -pi -e '<regex>' file

but for $subject i did something like
ruby -e 'p gets.gsub(....).gsub(....).gsub(....) while gets' file

is there an equivalent expression in perl?
And, does anyone know a smart expression to delete lines, which only contain any kinds of spaces?

Till now i use:
ruby -e 'puts readlines.to_s.gsub(/\n{2,}/,"\n").split(/\n/)' eddi-bef.dump > 1table

Thanks
ralf

"Ralf Müller" <r_mueller@imp-ag.de> schrieb im Newsbeitrag
news:200407300950.52559.r_mueller@imp-ag.de...

hi out there,
i wanted to $subject of a file. For a single regex, i used perl (ok,

that's my fault):

perl -pi -e '<regex>' file

but for $subject i did something like
ruby -e 'p gets.gsub(....).gsub(....).gsub(....) while gets' file

is there an equivalent expression in perl?

That's a Perl question, which is probably better answered in a Perl NG.

And, does anyone know a smart expression to delete lines, which only

contain any kinds of spaces?

egrep -v '^[[:space:]]*$' <file>

Till now i use:
ruby -e 'puts readlines.to_s.gsub(/\n{2,}/,"\n").split(/\n/)'

eddi-bef.dump > 1table

Much more efficient:

ruby -n -e 'print $_ unless /^\s*$/' eddi-bef.dump > 1table

    robert

ruby -ne 'print unless /^\s*$/' file

or

ruby -pe 'next if /^\s*$/' file

martin

···

Ralf Müller <r_mueller@imp-ag.de> wrote:

And, does anyone know a smart expression to delete lines, which only
contain any kinds of spaces?

Till now i use:
ruby -e 'puts readlines.to_s.gsub(/\n{2,}/,"\n").split(/\n/)' eddi-bef.dump > 1table