Re: newline...be gone
your 'newline' character might be chr(13) so a chop might do better for you or my $newline = chr(13); $line =~ s/$newline//; ... HTH JY - Original Message - From: "David Byrne" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Wednesday, October 08, 2003 3:08 PM Subject: newline...be gone > Greetings, > > I have a question that probably easy to many... > > How can I get rid of the newline at the end of $line > (which transfers to $remainder after splitting)? > > foreach $filename (@filelist) { > open(INPUT,"$filename"); > foreach $line () { > chomp($line); > my ($gene,$remainder) = split(/\t/,$line,2); > chomp ($remainder); > $genedex{$gene} .= "$remainder\t"; > } > } > > > I've tried substituting, chomping, but the newline > remains. It's gotta be something obvious... > > Thank you very much, > David > > __ > Do you Yahoo!? > The New Yahoo! Shopping - with improved product search > http://shopping.yahoo.com > ___ > Perl-Win32-Users mailing list > [EMAIL PROTECTED] > To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
RE: [SPAM] newline...be gone
I would try: s/\n//g; This should replace every newline with nothing, globally. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of David Byrne Sent: Wednesday, October 08, 2003 4:09 PM To: [EMAIL PROTECTED] Subject: [SPAM] newline...be gone Greetings, I have a question that probably easy to many... How can I get rid of the newline at the end of $line (which transfers to $remainder after splitting)? foreach $filename (@filelist) { open(INPUT,"$filename"); foreach $line () { chomp($line); my ($gene,$remainder) = split(/\t/,$line,2); chomp ($remainder); $genedex{$gene} .= "$remainder\t"; } } I've tried substituting, chomping, but the newline remains. It's gotta be something obvious... Thank you very much, David __ Do you Yahoo!? The New Yahoo! Shopping - with improved product search http://shopping.yahoo.com ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
RE: newline...be gone
[EMAIL PROTECTED] wrote: > Subject: newline...be gone > > > Greetings, > > I have a question that probably easy to many... > > How can I get rid of the newline at the end of $line > (which transfers to $remainder after splitting)? If it is not off your system and you are getting the data from Unix, then their end of line and the end of line for Windows are different. So when you do chomp, chomp uses the variable $/ and what it has for doing the chomp. Otherwise if win to win, does not make sense. Chomp works like a champ at what it does. Wags ;) > > foreach $filename (@filelist) { > open(INPUT,"$filename"); > foreach $line () { > chomp($line); > my ($gene,$remainder) = split(/\t/,$line,2); > chomp ($remainder); > $genedex{$gene} .= "$remainder\t"; > } > } > > > I've tried substituting, chomping, but the newline > remains. It's gotta be something obvious... > > Thank you very much, > David > > __ > Do you Yahoo!? > The New Yahoo! Shopping - with improved product search > http://shopping.yahoo.com > ___ > Perl-Win32-Users mailing list > [EMAIL PROTECTED] > To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs ** This message contains information that is confidential and proprietary to FedEx Freight or its affiliates. It is intended only for the recipient named and for the express purpose(s) described therein. Any other use is prohibited. ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
newline...be gone
Greetings, I have a question that probably easy to many... How can I get rid of the newline at the end of $line (which transfers to $remainder after splitting)? foreach $filename (@filelist) { open(INPUT,"$filename"); foreach $line () { chomp($line); my ($gene,$remainder) = split(/\t/,$line,2); chomp ($remainder); $genedex{$gene} .= "$remainder\t"; } } I've tried substituting, chomping, but the newline remains. It's gotta be something obvious... Thank you very much, David __ Do you Yahoo!? The New Yahoo! Shopping - with improved product search http://shopping.yahoo.com ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs