Re: Can Python fix vcard files?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Dotan Cohen

    Re: Can Python fix vcard files?

    2008/10/14 <skip@pobox.com >:
    Off the top of my head I don't know (and it may well vary by Python
    version). Just leave out the dangerous parts of the loop to check:
    >
    for f in glob.glob('*.vc f'):
    # corrupt data
    uncooked = open(f, 'rb').read()
    # fix it
    cooked = uncooked.replac e('\n ', '')
    # and write it to the bit bucket
    open(os.path.de vnull, 'wb').write(coo ked)
    >
    Skip
    >
    Thanks, Skip. I don't quite follow but I've got enough to google on
    now. In any case I see that there are unicode-specific parts to TFM so
    I'm rather faithful that any gotchas will be spelled out there.

    Thanks!

    --
    Dotan Cohen



    א-ב-ג-ד-ה-ו-ז-ח-ט-י-ך-כ-ל-ם-מ-ן-נ-ס-ע-ף-פ-ץ-צ-ק-ר-ש-ת

    ä-ö-ü-ß-Ä-Ö-Ü
Working...