Menu

Questions regarding tabs and others

2014-09-05
2014-09-08
  • Javier Bazan

    Javier Bazan - 2014-09-05

    Hello,

    Hi!

    First of all thank you for this great tool.

    I wanted to know how to add content to the second tab of a template spreadsheet. For example I run a script and by default everything is added on the first sheet which is great. Then I run a second script to collect other information and I want to add that to the second sheet of the same spreadsheet however the "-t 2" does not seem to work and actually when I open the file nothing is there, sheet #1 and sheet #2 contain nothing.

    The other question I have is: How do you specify csv2odf to append the data to after the last line of a spreadsheet? I run loops for multiple servers and I would like to create a big spreadsheet with all the info from instead of one per server.

    Thank in advance.
    Best regards,

     
  • Larry Jordan

    Larry Jordan - 2014-09-06

    Hi,
    As you said, when you add data to two or more tabs, you need to run csv2odf once for each tab, like this:

    csv2odf data1.csv template.ods temp1.ods
    csv2odf -t 2 data2.csv temp1.ods output.ods
    

    Notice the output of the first run goes to a temporary file, which is used as the template for the second run. You could also do it with a pipe like this:

    csv2odf data1.csv template.ods | csv2odf -t 2 --template-stdin-ods data2.csv output.ods
    

    On the second question, you can tell the program to skip rows with the -S option (capital S). For example this would skip the first 16 rows of the template:

    csv2odf -S 16 data.csv template.ods output.ods
    

    That could be used to place a second set of data below previously added data, however you would need to know how may rows were added in the first set. That might work if the first set has a fixed number or rows, or if you are running manually (not in a script) and can just tell it how many rows to skip,

    Let me know if that works for you.
    Larry

     
    • Javier Bazan

      Javier Bazan - 2014-09-08

      Thanks for the prompt response Larry.

      For the tabs, I've understood what you suggested and I have applied but no success. I'm using Libre Office Calc 4.3 and Microsoft Excel 2010 to open the spreadsheet. Perhaps a compatibility problem? Which software are you using to open them?

      This is my sintax:

      csv2odf -c "," $CSV1 $TEMPLATE $OUTPUT
      csv2odf -c "," -t 2 $CSV2 $OUTPUT $OUTPUT2

      I then send the file through email with uuencode, I open it and only the first tab has the info, the second one has nothing.

      Any ideas?
      Thanks again,

       
      • Larry Jordan

        Larry Jordan - 2014-09-08

        I did some tests and found there is a problem when the second tab is blank. This happens because a blank tab does not contain real cells. I want it to generate cells on blank tabs, but apparently that is not working.

        A quick fix would be to add a header row and sample data to all the tabs that will receive data. The example files show how to do that. Try that and let me know if it works.

        I will add this to my list to fix in a later release.

        Thanks.
        Larry

         
  • Javier Bazan

    Javier Bazan - 2014-09-08

    Btw I'm using "xlsx" format for both template and and output files. Thanks.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.