Nagrale, Ajay wrote:
> The flow in the script is something like this:
>
> 1. Open the input file handle using the open function
> 2. In while loop parse the entries (using the file handle
> directly in while), parse the input entries. Do the sanity
> check required (sanity check involved is a combination of
> specific line format and a few regular expression check). If
> sanity check is successful, load the required entries into the
> hash. Close the input file handle.
> 3. Open the output file handle
> 4. Sorting of the hash in the required order.
> 5. Print hash into the file
> 6. Close output file handle.
>
> Any help/suggestion would be appreciated.

* Keep track of the last item in the file via tell() and seek() that
location at the next run.

* Keep the previous sorted output in a file with the format: sort_key
(delimiter) output_line

* Merge sort the new entries with the old output to produce the output
and a new sorted file.


-- 
__END__

Just my 0.00000002 million dollars worth,
   --- Shawn

"For the things we have to learn before we can do them, we learn by
doing them."
  Aristotle

* Perl tutorials at http://perlmonks.org/?node=Tutorials
* A searchable perldoc is at http://perldoc.perl.org/


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to