Hello Perl Monks,

I've been playing around with Spreadsheet::ParseExcel and have had success extracting info from a vertical table. I am now looking at extracting info from a horizontal table which is not completely bound. So was hoping someone here has some advice for me:

My scenario is:

I have an excel spreadsheet with 3 sheets. Sheet1,Salary has the below:

Name, Salary in columns B & C. Extending 10 rows.

Name, Mon-DD Monica 104,000 Meredith 110,000 Brian 92,000 Madeline 112,0000 Averie 140,0000

The above is pretty straightforward to extract

The same spreadsheet has the below data

Col E through J Row 6 Col E ColF ColG ColH ColI Col J Row 7 Monica Meredith Brian Madeline Averie Row 8 104,000 110,000 92,000 112,000 140,000 Row9 Row 10 Salary 100,000 105,000 85,000 110,000 125,000 Row 11 Salary% 75% 71% 80% 81% 69% Row 12 Row 13 Bonus 4,000 5,000 7,000 2,000 15,000 Row 14 Bonus% 10% 20% 10% 2% 14%

Now my questions, what is the best way I can parse this data using SpreadSheet::ParseExcel and store the results in a table of the below structure. How do I make sure that the Salary, Salary%, Bonus, Bonus% are tying to the same name?

Name Total_Salary Salary Salary% Bonus Bonus% Monica Meredith Brian Madeline Averie

I'm hoping to do this without using any VBA or Excel specific tools. Any guidance using this library will be greatly appreciated. I apologize in advance if the formatting seems off or if the question itself sounds vague. Thanks for your help in advance

Regards, Simak


In reply to Parsing horizontal table in Excel & loading it into a database by simak29

Title:
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, details, 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, summary, 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.