in reply to Re: Print to Less Screen
in thread Print to Less Screen
My apologies for being all over the place yesterday. I would like to try to better define my problem and what I'm looking to do (the less screen is only a small part of it and really I should have picked a better subject). Here is the program and how it should process:
1) Take user input and pass it to an external program which does a database query using an SQL statement.
2) Results from query can be extremely large, so storing them in memory doesn't seem to be a good idea. Either store in a temp file, or pipe the input into the program (if possible).
3) Do processing on results. Specifically, sorting in different user-defined ways, and regex find/replaces on about half of the fields to clean them up. Also I need to format the results for a decent visual output (which I do using printf).
4) Output processed data to a less screen for the user. Again, this data can be very large, so I would need to store it in another temp file?
If anyone can give me a general idea of the best way they think I can do this, I would greatly appreciate it!
Currently my thoughts are that I need to store the data in a temp file in order to do a sort (couldn't pipe it in?) I would use the Perl module File::Temp and store two temp files- One for the DB results, and one for the results of the sort, regex replacements, and printf formatting.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Print to Less Screen
by armstd (Friar) on Jun 05, 2011 at 14:28 UTC | |
by bigbot (Beadle) on Jun 06, 2011 at 01:44 UTC |