Author Topic: Excel Hell  (Read 3283 times)

0 Members and 1 Guest are viewing this topic.

Offline Striketh

  • Thread Starter
  • Posts: 69
Excel Hell
« on: Wed, 02 November 2011, 13:07:39 »
Hey folks,

So, I've been placed in charge of building a spreadsheet at work. There's really no timeline on it, and they're liberal with how long it takes me to do it, but I have NO IDEA where to even start. It requires parsing raw data to build a spreadsheet, and I'd need to do some mathematics in order to do so. Unfortunately, I am probably the worst mathematician on the planet.

I basically have a list, like the below, except it's a couple hundred lines longer:

Cronjob | # of Servers | Every minute | Every hour | Every day | Every week | Every month
-----------------------------------------------------------------------------------------
CronHere|     187       |              N         |     N      |   Y       |    Y       |    Y      

What I need to do is export it to CSV (the easy part) and then try to figure out how to parse it either with a perl script, or just some fancy awk scripting (both of which I'm useless with) in order to build a human readable chart of cron jobs.

This is pretty much over my head, so if anyone has any experience doing something similar I'd appreciate the help.

Offline alaricljs

  • I be WOT'ing all day...
  • ** Moderator Emeritus
  • Posts: 3715
  • Location: NE US
Excel Hell
« Reply #1 on: Wed, 02 November 2011, 13:13:01 »
I fail to see use of math here, I also fail to see what you need to do.  It sounds like you already have the spreadsheet... is that not considered human readable?
Filco w/ Imsto thick PBT
Ducky 1087XM PCB+Plate, w/ Matias "Quiet Click" spring-swapped w/ XM Greens

Offline Striketh

  • Thread Starter
  • Posts: 69
Excel Hell
« Reply #2 on: Wed, 02 November 2011, 13:22:37 »
Sorry, I wasn't clear. That's just an example of how it needs to end up. The raw data I need to parse is raw cron data. For example

14 22 * * * /some/cron/here

I need to output it in that format as the script needs to do the following:

1. Parse raw cron data in multiple files (all servers are in their own files i.e. server1.log, server2.log, etc.)

2. Calculate how many servers are running each cron job and add a total in the # of Servers column

3. Add a Y if it executes in the appropriate time column, or a N if there's a * in the cron job itself.

That's the minimum that needs to be done to generate a useable CSV. The math part comes in if somehow these stats could be compiled together and then an output on the times they're running could be generated, as well as generating a column on how often each cron job would be run on each server in a year.

Offline redpill

  • Posts: 503
Excel Hell
« Reply #3 on: Wed, 02 November 2011, 14:49:52 »
If you can get the various files to dump into a single excel sheet, the rest should be pretty straightforward formula work from there.  I don't know any script languages to automatically take the files and import them to Excel, but once you get them there I can help with formulas.

^ Current Favorite ^  Topre Realforce 87UB 55g  |  Topre Realforce 103UB 55g | KBC Poker/Browns/Sanded KeycapsDucky 1087 | Filco MajesFoam-2 | IBM Model M 1390131 Feb '87 | Still Love: Microsoft Trackball Explorer x3 | Now Unused:  Microsoft Natural Ergo 4k x2

Offline Striketh

  • Thread Starter
  • Posts: 69
Excel Hell
« Reply #4 on: Wed, 02 November 2011, 15:01:32 »
Yeah, I just need to figure out how to parse the raw data and dump it into a CSV format somehow =\

Offline flyball

  • Posts: 258
Excel Hell
« Reply #5 on: Fri, 04 November 2011, 04:11:33 »
just use a regexp. here's a tutorial for perl http://perldoc.perl.org/perlretut.html. or get something off cpan like this http://search.cpan.org/~scottw/Config-Crontab-1.33/Crontab.pm
« Last Edit: Fri, 04 November 2011, 04:17:56 by flyball »
[SIGPIC][/SIGPIC]