in reply to Process large text data in array

Sorry, post into separate reply. I re-post reply here so others can easily view.

hdb your codes are excellent!! The speed reduced to only 21sec to complete. My previous sub codes were rather old and previous data format may contain more than 1 delimiter characters. But all my current data format will have "safe characters" encoding before storing. So I guess it is safe to use your code for my purpose use.

If it is not too trouble, maybe could you help me improve the reversal of line2rec? Or that is the simplest and faster it can goes?

#---------------------------------------------------# # REC2LINE #---------------------------------------------------# sub rec2line { my (%trec) = @_; my ($newline) = ""; my ($line); foreach $line (keys %trec) { if ($newline ne "") { $newline .= "|"; } $newline .= "$line=$trec{$line}"; } # end foreach return ("$newline"); } # end sub

Thanks again.