Your skill will accomplish what the force of many cannot |
|
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
Thanks for the interesting example... I had to try it as the times you quoted seemed very fast. But on my P4 with 512Mb RAM, and <who knows?> disc speed your program creates the file in around 3.5 secs!
However the "converted file" only contained "\n"s. I'm no guru, but I worked out that (I think) you need a split before the join, or you won't have a list that join requires. print OUTFILE join (",", (split /(XXXXXXXXXX)/)), "\n"; worked, sort of, for me - I couldn't get your /(.{,10})/ pattern to work, although I think I understand what it's trying to match - any 10 chars exactly and reflect those in the stream as well as the other characters - which in this case aren't any. The resulting file simply had "\n"s as the split didn't seem to find a match. This then took around 20 seconds...
This results in lines containing collections of 10 sets of the following ",XXXXXXXXXX," so that 2 commas appear between adjacent groups of X's and at the beginning and end of each line.
In reply to Re: Re: What's the most efficient way to write out many lines of data?
by hagen
|
|