Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: Search string from an input file in a different file

by sundialsvc4 (Abbot)
on Mar 20, 2018 at 13:55 UTC ( #1211323=note: print w/replies, xml ) Need Help??


in reply to Search string from an input file in a different file

Although this is a Perl-specific forum, by far (IMHO) the easiest way to approach this task is to load the information into a SQLite database, where you can then answer these and many other similar questions using SQL queries ... no custom coding is needed at all.   The information can also be used directly by a spreadsheet, since every spreadsheet known to man will have an available interface to this database (and others).

The obvious advantage of SQLite, besides the fact that it is free – in the public domain, actually – is that the database is simply a file:   no “database server” is required.   (So you don’t need to ask – and, be turned-down by – anyone’s IT Department.)   The suite includes tools for importing and exporting CSV data.   And it can graciously handle pretty much any volume of data that you care to throw at it.   There’s really nothing “Lite” about it.

So, in this scenario, you would create two tables, say node and interaction, and now you would write queries which JOIN between these two tables and then summarize the results.   All of this is being accomplished without any custom coding at all – Perl or otherwise.   If you want some query to be the data-source for some named-range in your spreadsheet, this is also no problem.   (It is much cleaner and easier than diving into “DLookup() hell” in a traditional spreadsheet model.)

For completeness, I should also mention that Microsoft Excel® has some native database capabilities, even if you do not own a license for Microsoft Access.®   So, SQLite is by no means the only way to apply “a database that does not require an SQL server.”   But I consider the intrinsic database capabilities of OpenOffice and LibreOffice (“OpenOffice Base”) to be much more primitive – essentially unusable IMHO – by comparison.   If you’re not working in a Microsoft environment, definitely use SQLite.

Another tool – also free – for more advanced statistical analyses is the open-source language "R", which is a bit unusual in that it is a programming language specifically designed for statistics work.   Once again, many spreadsheets and other tools (including the “big boys,” SAS® and SPSS®) have ready interfaces to it, because it accomplishes certain tasks much more easily than they can do without it.   I doubt that you will need it here, but I mention it in passing.

(Yes, I have done extensive work in this area, and know whereof I speak.)

  • Comment on Re: Search string from an input file in a different file

Replies are listed 'Best First'.
Re^2: Search string from an input file in a different file
by stonecolddevin (Parson) on Mar 20, 2018 at 18:07 UTC

    Why the hell are you telling him to use Excel? This is a programming forum

    Three thousand years of beautiful tradition, from Moses to Sandy Koufax, you're god damn right I'm living in the fucking past

Re^2: Search string from an input file in a different file
by Anonymous Monk on Mar 20, 2018 at 14:35 UTC
    (Yes, I have done extensive work in this area, and know whereof I speak.)
    You're full of it, and this is a crap post. Perl able to read these files without straining itself.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1211323]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (3)
As of 2019-07-24 07:06 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    If you were the first to set foot on the Moon, what would be your epigram?






    Results (32 votes). Check out past polls.

    Notices?