Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Re: It's all getting messy - remove whitespace

by tinita (Parson)
on Jun 15, 2014 at 10:50 UTC ( [id://1089933]=note: print w/replies, xml ) Need Help??


in reply to It's all getting messy - remove whitespace

Whenever you don't know what's in your data (you think it contains whitespaces) print it to make sure.
use Data::Dumper; local $Data::Dumper::Useqq = 1; # make "invisible" characters visible print Dumper \@spliceout;

Then read about array interpolation in perldata:
Arrays and slices are interpolated into double-quoted strings by joining the elements with the delimiter specified in the $" variable

The problem is in this line:
  print MYFILE (">" . "$col_ID[$i]" , "@spliceout" , "\n");

Replies are listed 'Best First'.
Re^2: It's all getting messy - remove whitespace
by lecb (Acolyte) on Jun 15, 2014 at 11:21 UTC

    Thank you! I have modified the script and it now works!

    my @splicejoin = join('', @spliceout); open (MYFILE, '>>fasta'); print MYFILE (">" . "$col_ID[$i]" , "@splicejoin" . "\n"); + close (MYFILE);

    Many thanks for the quick responses and for pointing me in the direction about it not actually being whitespace; didn't realise I could do that. Thanks again.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1089933]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others studying the Monastery: (5)
As of 2024-04-20 00:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found