Page 3 of 3 FirstFirst 123
Results 21 to 23 of 23

Thread: C, fprintf with commas

  1. #21
    squakie is offline I Ubuntu, Therefore, I Am
    Join Date
    Oct 2012
    Beans
    2,238
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: C, fprintf with commas

    Well, stupid me. All I had to do was go to my gmail account an export my address book. That gave me the initial string showing the field names so now I can build the entire thing for my brother in-law.

  2. #22
    squakie is offline I Ubuntu, Therefore, I Am
    Join Date
    Oct 2012
    Beans
    2,238
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: C, fprintf with commas

    1 more question:

    how do I output a single comma to a file?

    I've tried:

    fprintf(outfile,",");

    but the compiler flags it as an error at the first quote.

    So I tried:

    fputc(',',outfile);

    but the compiler gets upset a the first single quote.

    I tried:

    char my_comma[] = ",";

    then using:

    fputc(my_comma[0], outfile);

    but the compile gets upset at the "m" of my_comma[0].

    This seems like it should be the simplest thing to do, but I can figure it out.

    Any help would be GREATLY appreciated!

  3. #23
    squakie is offline I Ubuntu, Therefore, I Am
    Join Date
    Oct 2012
    Beans
    2,238
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: C, fprintf with commas

    Found a stray "}" in the middle of the code - removed that and don't have any problem fprintf'ing the commas.

    In fact, the entire thing seems to be working right now - I limported the output to my "testing" gmail account contacts and it appears to be want I think my brother in-law wants. It's a little strange - gmail contacts main screen only shows the last name followed by the email address. When there is a name like "Ibe Me" it only showed up as "Me". I had to combine the first name and last name from the input to make the output - so it at least shows "Ibe Me" followed by the email address. The actual contact card obviously looks really strange.

    So, for the limited number of fields that show in my brother in-law's Juno address book of type .nv, I can read it, partse it, and create output that can be imported to the gmail contacts list. That's doing what I need it to do.

    If anyone wants a copy of it to expand it to include the possible fields from a full Juno address entry, or to add other formats for other email clients someone may wish to "import" their Juno address book to, etc..

    If not, well it worked for what I needed.

    I want to thank everyone SO much for putting up with a "re-born" green-horn!

Page 3 of 3 FirstFirst 123

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •