Skill, Microsoft Excel, and a .csv file?

Discussion in 'Cadence' started by brian.j.reed, Feb 22, 2008.

  1. brian.j.reed

    brian.j.reed Guest

    I would like to write a skill code that accesses a Microsoft Excel
    file and saves that information aside as a .csv file. Is this
    possible?

    Sincerely,
    Brian J. Reed
    IBM Systems &Technology Group, Development
    Circuit Design Engineer
     
    brian.j.reed, Feb 22, 2008
    #1
  2. brian.j.reed

    DReynolds Guest

    Brian, I would think the easiest way is to dump csv from excel, modify
    it with skill, then import it back to excel

    David
     
    DReynolds, Feb 25, 2008
    #2
  3. brian.j.reed

    Riad KACED Guest

    Hi Brian,

    I have no knowledge of any skill function that reads excel file ...
    I know however that other languages like Perl and Python (and most
    likely others but I have no experience) support libraries and classes
    to read from / write to MS Excel files.

    I know also that skill handles a set of functions that allows you
    executing unix commands/scripts from your skill functions. such
    functions are system("yourUnixCommand"), sh("yourUnixCommand"),
    csh("yourUnixCommand") ... The output of these functions however is
    directed to unix window where they have been called.

    I guess you are not just interested in generating the csv file but
    interested also in post processing the data in your skill function. So
    if you want your skill procedure to get these data, the best for you
    is to use the Interprocess Communication (IPC) SKILL functions. They
    allow you to create and communicate with child processes. You can find
    more information about the ipc functions in the Cadence
    documentation :
    <CADENCE_INSTALL_DIR>/doc/skipcref/skipcref.pdf

    An example of using IPC SKILL functions is :
    ; This piece of code gets the hostname

    cidHost = ipcBeginProcess("uname -n")
    ipcWait(cidHost)
    ridHost=car(parseString(ipcReadProcess(cidHost) "\n"))

    Well, the solution I'm proposing is then :
    1. Write a perl/python/OTHER script that dumps the MS Excel file into
    csv
    2. Call this script from skill using the above described functions
    depending on what you want to do. You have then to post process the
    output data with your skill procedure.

    For your information :
    1. Perl supports the following libraries to deal with MS Excel file :
    + Spreadsheet::WriteExcel -->
    http://search.cpan.org/~jmcnamara/Spreadsheet-WriteExcel-2.20/lib/Spreadsheet/WriteExcel.pm
    + Spreadsheet::parseExcel
    http://search.cpan.org/~szabgab/Spreadsheet-ParseExcel-0.32/lib/Spreadsheet/ParseExcel.pm
    + ...

    2. Python supports the following libraries to deal with MS Excel
    file :
    + pyExcelerator --> http://pypi.python.org/pypi/pyExcelerator/0.6.0a
    + pyXLWriter --> http://pypi.python.org/pypi/pyXLWriter/0.4a2
    + xlrd --> http://pypi.python.org/pypi/xlrd/0.6.1
    + ...

    I'm actually lacking experience with Cadence IC 6 and I'm just
    wondering if there is a better way to handle this with the new
    framework/database. I think nobody has better knowledge of this area
    than Andrew does.

    Good luck !

    Riad.
     
    Riad KACED, Mar 2, 2008
    #3
  4. Riad KACED wrote, on 03/02/08 14:26:
    There's nothing (as far as I know) to read Excel files in IC6.X - to be honest,
    you'd be better off using CSV or tab-separated files instead - as they're then
    more portable.

    Or XML of some sort.

    If you write out a tab-separated file with a suffix ".xls", Excel will read it
    directly in Windows...

    Regards,

    Andrew.
     
    Andrew Beckett, Mar 3, 2008
    #4
Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.