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

Re^3: change \n to \t

by Laurent_R (Canon)
on Aug 23, 2019 at 16:06 UTC ( #11104908=note: print w/replies, xml ) Need Help??

in reply to Re^2: change \n to \t
in thread change \n to \t

Actually, my DATA file is huge.
Then you're probably doing the wrong way using two arrays to store the contents of the file. It is better to read, process and output one line at a time.

For example something like this:

open my $IN1, "<", "1.fa" or die "Cannot open input file"; open my $OUT, ">", "1.txt" or die "Cannot open output file"; while (my $line = <$IN1>) { # Do here whatever transformation/substitution you need to $line print $OUT $line; } close $IN1; close $OUT;
This will be faster and will consume much less memory.

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (5)
As of 2021-10-19 13:21 GMT
Find Nodes?
    Voting Booth?
    My first memorable Perl project was:

    Results (76 votes). Check out past polls.