Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?

Comment on

( #3333=superdoc: print w/replies, xml ) Need Help??

Here's the story of my first perl program...

I was talking to a co-worker of mine and she shows me this "project" (busy work) her boss had given her - A client had sent us about 2000 Word documents - one page each, full of tables filled with various bits of data. Her boss wanted the information from about 10 different fields on every document transferred to an Excel spreadsheet.

If that wasn't tedious enough, the Word documents were password protected and the text couldn't even be selected to copy and paste into a spreadsheet, and it wasn't possible to run a macro on it. She had been manually typing everything into the spreadsheet!

Now, I had just started to learn perl - my first programming language really, (besides some BASIC in the 80's) but I told her I'd give it a shot.

Since the Word docs were all created from the same template, each field was preceded by the same proprietary microsoft garbage. I opened some files in a hex editor and figured out some pretty nasty looking regular expressions to find the fields, then write them out to a csv file. I don't think it took much more than a minute for it to run through all the Word docs. Being my first program, it took me a few days to get it working well, but the project was still done 2 weeks ahead of schedule. I think my coworker ended up taking all the credit for it, but I got enough satisfaction out of creating something useful that actually worked.

I've been hooked on perl ever since!

In reply to Re: Once AGAIN perl saved my bacon by Anonymous Monk
in thread Once AGAIN perl saved my bacon by AcidHawk

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

  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?

    What's my password?
    Create A New User
    and all is quiet...

    How do I use this? | Other CB clients
    Other Users?
    Others wandering the Monastery: (5)
    As of 2017-12-11 04:31 GMT
    Find Nodes?
      Voting Booth?
      What programming language do you hate the most?

      Results (286 votes). Check out past polls.