Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: Incorrectly adding a newline character

by vinoth.ree (Monsignor)
on Oct 08, 2013 at 04:38 UTC ( #1057355=note: print w/replies, xml ) Need Help??


in reply to Incorrectly adding a newline character

Try Chomping an array If you chomp an array, it will remove a newline from the end of every element in the array

So, try the blow code and tell what happens!

open (IN, $ARGV[0]); open (OUT, ">output.txt"); while ($line = <IN>){ chomp $line; @line=split/\t/,$line; chomp(@line); print OUT $line[1]."\t".$line[2]."\t".$line[2]."\n"; } close( OUT);

All is well

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1057355]
help
Chatterbox?
[holli]: i just keep spamming
[holli]: writing a cb client in operl 6

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (2)
As of 2017-09-23 12:06 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    During the recent solar eclipse, I:









    Results (272 votes). Check out past polls.

    Notices?