I'm pulling down some LUN usage data once per day. I store the data in a file name that matches the name of the LUN. Then I just append new usage amounts to the same file each day.
Filename might be serv01_luna, serv01_lunb, serv01_lunc, etc, etc.
Inside the file it would like the following to put into Excel and chart. Sizes may or may not increase:
It is pretty easy to import data into Excel, by putting it in tab-separated-text or Comma-Separated-Value (csv). Note that the rules for csv include " to hide ',' and even newline inside columns, "" to encode a literal " and lines ending in cr-lf. Old versions of MS Access ignored these rules, so tab-separated is also great unless you need tabs in your columns!
If your data is not going to stay within the span of a worksheet, 256 x 4096 cells, send it to a database. You can still attach the database to Excel with a data fetch query.
There are PERL and other libraries to write code that writes Excel, and the new XML xlsx format must make that a cinch. Then, you can chop big data into many worksheets.
Still, it is nice to tuck it away in a RDBMS in the middle. Many free fine ones are out there, many with ODBC and JDBC access so you can work them with other free tools like IDE plugins and SQuirreL, the universal JDBC RDBMS GUI.
At the expense of coming across as pedantic, isn't the data you are storing going to be used for something else, such as a report or a graph? The data structure example you provide would not seem the most efficient way to build a report or graph off of. I dont even think Excel would be the optimal solution for this.
I concur with DGPickett that your first choice should be to write a script in for example Perl that transforms your data that is better suited for a database and subsequently analyse your data from there. Then Excel is probably not going to be part of the solution.
If you put it into a database daily, there is much less to format. If you format as you collect, in distributed collection scripts, bash could do all the parsing necessary to make each row. A cron on each host could ensure the data is collected same time every day, or even hourly, even if the network or report host is down. The report host could collect the files via ssh, rsync, rsh, ftp or they could NFS to the report host from local on the end host (not the other way around, see prior sentence).
Can the awk script be easily modified to do something like this instead?
Dunno...now that I'm thinking more about DB stuff, wondering how my columns might look. the LUN name will always be the same. The date and sizes are what are changing.
It certainly can. But - at least for the relational DBs that I know - if the data go into one table, you would need a foreign key in there to reference the server/lun the data belong to. Thus you could use the script as is to populate the DB. If it goes to different tables, you might be able to use your original files.