GithubHelp home page GithubHelp logo

Comments (8)

ajrosen avatar ajrosen commented on July 26, 2024 1

I've just released version 1.2.0 which fixes CSV output. Thank you for the bug report!

from icalpal.

ajrosen avatar ajrosen commented on July 26, 2024

Hello!

Could you tell me which options you're using?

I suspect the problem occurs when some rows don't have the same fields as others. I see similar behavior with my own calendar.

from icalpal.

selasphorus avatar selasphorus commented on July 26, 2024

I've been limiting the results to specific calendars, and setting the date format, like so:
icalPal events --from 20240301 --to 20240331 --ic 'Performing Arts' -o csv > test-240402-1.csv --df %Y-%m-%d

Two additional observations:

  1. Initially I ran an export for several calendars at once. When I run separate exports for each calendar, each seems to have a slightly different set of columns. They're all CALDAV calendars associated with my google account, so I can't think why they'd yield such different results.
  2. If I try to select only certain columns for export, the additional option has no effect on the output. For example:
    icalPal events --from 20240301 --to 20240331 --ic 'Performing Arts' -o csv > test-240402-1.csv --iep sdate, edate --df %Y-%m-%d. Maybe I'm using that option incorrectly?

from icalpal.

ajrosen avatar ajrosen commented on July 26, 2024

There are a couple changes you need to make to the command.

  1. When saving to a file, the > test-240402-1.csv needs to come last. The shell stops reading arguments when it sees the redirection operator, so any options after that are not getting to icalPal.
  2. Also change --iep sdate, edate to --iep sdate,edate. Remove the space after the comma.

from icalpal.

ajrosen avatar ajrosen commented on July 26, 2024

This is a lot more involved than I anticipated. I assumed a lot more "magic" in Ruby's CSV class than it actually has.

Also, the machine-readable outputs (csv, hash, json, yaml) always print all fields. Many options, including --iep, --eep, and --aep, are ignored. This isn't a problem for hash, json, or yaml; those label every field in every item.

But CSV has one set of labels (the header row) for all items. Any item that has different fields than the first one will look wrong.

It'll take some time to fix. Until then, I suggest using a different format if possible. Or fix the output manually to align the columns.

from icalpal.

selasphorus avatar selasphorus commented on July 26, 2024

Thanks very much for looking into it. I would offer to help work on a fix, but I'd have to start from scratch learning Ruby and I don't have time for that currently. I wonder how tricky it would be to add an xml output option? I'm trying to streamline a workflow using a particular WP import plugin that only accepts csv and xml files. Perhaps there's a utility for easily converting yaml to xml -- I'll go look -- but it would be super to not have to add another step.

from icalpal.

selasphorus avatar selasphorus commented on July 26, 2024

Thanks so much! Sorry for the slow reply. I'll try it out today!

from icalpal.

selasphorus avatar selasphorus commented on July 26, 2024

Works like a charm! Thanks again :-)

from icalpal.

Related Issues (10)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.