
Laurent_R
Veteran
/ Moderator
Jan 18, 2014, 4:02 PM
Post #2 of 3
(14961 views)
|
Re: [arnarisetty] Remove new line character
[In reply to]
|
Can't Post
|
|
Maybe something along the lines of this untested piece of code:
while (my $line = <$INPUT>) { while ($line !~ /^([^|]*\|){10}/) { $line .= <$INPUT>; } # do something with $line } or possibly:
while (my $line = <$INPUT>) { $line .= <$INPUT> while ($line =~ s/\|/\|/g) < 10; # do something with $line } Again, this is untested, I *think* both ideas should more or less work, but there may be some mistakes. If it does not work and if you need further help, please provide some input data to make testing possible.
(This post was edited by Laurent_R on Jan 18, 2014, 4:03 PM)
|