Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
YES! Get text in, send text out. Doesn't matter what the language of the programs are!

As I mentioned above, it is possible for any of these languages to process a command line argument like "file name".
YourFORTRAN -f name for example.

But hearing about how much this file format will be "shuffled around", I even more strongly recommend the "filter" approach.

Update:

Another way to think about your input file, is that is a database. Well, what kind of operations can we do? 1) Transform it in some way by additions, deletions, or changes to existing records. 2) Make reports from it based upon some subset of the data, perhaps using some calculations from the data(or subset) and/or sorting of the data. All of these things can be done with the filter model.

Let's go through some simple tasks:
-generate some kind of report A of the whole dataset - ok, make a genreport filter. cat data | genreport.pl
-generate the same report but only between dates X -Y, - ok, filter out data not between those dates with a date filter and pipe result to the genreport filter.
cat data | date.pl -s startdate -e enddate | genreport.pl
this date gizmo might just be a fancy grep command..
-add records, just use cat (or type on Windows), cat new >>data
-delete records between dates, well that is just inverse of the date filter
-change in some way, use transform filter, I don't know what this would do but I hope you are getting the idea..

We are beyond Perl here, but the way to set up something like I think you need is to have a bunch of little "filter" programs that can be combined and used in different orders. These programs are "stitched together" via a shell script, not with Perl. Each of these programs takes to the extent possible input from STDIN and output goes to STDOUT.


In reply to Re^3: Data Transfer to Fortran by Marshall
in thread Data Transfer to Fortran by cheech

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (4)
As of 2024-04-25 05:43 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found