create report from csv file

Discussion in 'Perl Misc' started by Chris, Dec 31, 2007.

  1. Chris

    Chris Guest

    Does anybody know of a perl or something similiar that can take a csv
    database and create a report. Assumptions the csv file is presorted
    and is delimited with | pipes. Only one field will need to match.

    R&D

    Milpitas
    393 Licoln Drive 33,000 sq.ft. 1.20
    400 Maple Lane 12,000 sq.ft. 1.25

    San Jose
    31 First Street 40,000 sq.ft. 1.50
    9 Third Street 30,000 sq.ft. 1.40

    I've looked at ezscripting.com but they can't group by city.

    Thanks,
    Chris
    Chris, Dec 31, 2007
    #1
    1. Advertising

  2. Chris

    Guest

    On Dec 31, 1:30 pm, Chris <> wrote:
    > Does anybody know of a perl or something similiar that can take a csv
    > database and create a report. Assumptions the csv file is presorted
    > and is delimited with | pipes.


    Then it's not really a CSV file. CSV files are delimited with commas
    (that's what the "C" stands for).

    This task sounds like it could be handled by a trivial Perl script of
    about a half dozen lines.

    Even though you have made no apparent effort to locate or familiarize
    yourself with the posting guidelines for this newsgroup (posted here
    regularly and available at http://www.rehabitation.com/clpmisc/clpmisc_guidelines.html),
    you may yet find that some group participants are of good holiday
    cheer and may even be willing to toss a quick-and-dirty program at
    you. However, since you did not provide any example of your input
    data (only a poor description of it), it's hard to help you.


    --
    The best way to get a good answer is to ask a good question.
    David Filmer (http://DavidFilmer.com)
    , Dec 31, 2007
    #2
    1. Advertising

  3. On Chris <> wrote:
    >Does anybody know of a perl or something similiar that can take a csv
    >database and create a report.


    Calling CSV a database is somewhat a stretch of imagination.
    But yes, there are several modules that can parse CSV.

    > Assumptions the csv file is presorted
    >and is delimited with | pipes.


    Then it is not a CSV file.

    > Only one field will need to match.


    And which one would that be? And what is it supposed to match? And what do
    you want to do with the matched data?

    >R&D
    >
    >Milpitas
    >393 Licoln Drive 33,000 sq.ft. 1.20
    >400 Maple Lane 12,000 sq.ft. 1.25
    >
    >San Jose
    >31 First Street 40,000 sq.ft. 1.50
    >9 Third Street 30,000 sq.ft. 1.40


    That looks like the data is delimited by tab or hardcoded by position.

    jue
    Jürgen Exner, Jan 1, 2008
    #3
  4. Chris <> wrote:

    > Does anybody know of a perl



    What does "a perl" mean when you say it?


    > or something similiar that can take a csv
    > database and create a report.



    That should take less than 10 lines of Perl code.


    > Assumptions the csv file is presorted



    What does sorting have to do with your desired algorithm?


    > and is delimited with | pipes. Only one field will need to match.



    Need to match *what* ?


    > R&D
    >
    > Milpitas
    > 393 Licoln Drive 33,000 sq.ft. 1.20
    > 400 Maple Lane 12,000 sq.ft. 1.25
    >
    > San Jose
    > 31 First Street 40,000 sq.ft. 1.50
    > 9 Third Street 30,000 sq.ft. 1.40



    There are no pipe characters there.

    I thought you said that the data was delimited (but you meant separated)
    by pipe characters, so what does this data that you are showing have
    to do with the problem of splitting pipe-separated fields?


    > I've looked at ezscripting.com but they can't group by city.



    Look at writing a bit of Perl code instead.


    --
    Tad McClellan
    email: perl -le "print scalar reverse qq/moc.noitatibaher\100cmdat/"
    Tad J McClellan, Jan 1, 2008
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Tintin92
    Replies:
    1
    Views:
    1,663
    Andrew Thompson
    Feb 14, 2007
  2. Sonu
    Replies:
    1
    Views:
    787
  3. jliu66
    Replies:
    0
    Views:
    482
    jliu66
    Oct 19, 2007
  4. Eric
    Replies:
    0
    Views:
    359
  5. Li Chen
    Replies:
    18
    Views:
    636
    Azmi Farih
    Mar 23, 2010
Loading...

Share This Page