Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
Dear Monks,
I process a semicolon separated file. In doing so I use
my @parts = split(/;/,$_);
then I process some fields and then use
join (";",@parts)
to get it together.
In the file there are some empty fields at the end of the lines. In fact the last column ist e.g. always empty (except of the header).
The semicolons at the end of the line are lost through split and join.
How could I prevent it?
Many thanks!
VE
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Split and join - semicolons around empty fields are lost
by Corion (Patriarch) on Sep 06, 2011 at 07:20 UTC | |
Re: Split and join - semicolons around empty fields are lost
by Tux (Canon) on Sep 06, 2011 at 07:56 UTC | |
by james2vegas (Chaplain) on Sep 06, 2011 at 09:06 UTC | |
Re: Split and join - semicolons around empty fields are lost
by Anonymous Monk on Sep 06, 2011 at 08:21 UTC |
Back to
Seekers of Perl Wisdom