Output to csv file -is this hard?

This is a discussion on Output to csv file -is this hard? within the C++ Programming forums, part of the General Programming Boards category; Hi everyone, i was wondering how hard it was to output to a csv spreadsheet file. My program currently outputs ...

  1. #1
    Registered User
    Join Date
    Apr 2008
    Posts
    99

    Output to csv file -is this hard?

    Hi everyone, i was wondering how hard it was to output to a csv spreadsheet file. My program currently outputs to textfile but i wanted to make it a bit nice by putting it in a spreadsheet. Ive been having a look round and i cnt seem to find many resources to have a look at the see how this can be done, is it a really difficult task? Can anyone point me in the direction of sources to research?

    thank you

  2. #2
    Registered User
    Join Date
    Apr 2008
    Posts
    99
    sorryy again for double post, i think i could have cracked it. CSV files seem to be really easilly formatted so i think il write it all to a text file making sure its formmatted correctly then save it a .csv! It may not be pretty but it shud work!




    .....hopefully!

  3. #3
    Cat without Hat CornedBee's Avatar
    Join Date
    Apr 2003
    Posts
    8,892
    Yep, that's how it works.
    All the buzzt!
    CornedBee

    "There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
    - Flon's Law

  4. #4
    The larch
    Join Date
    May 2006
    Posts
    3,573
    Changing the extension of a file, if that's what you mean, doesn't do anything. In your C++ program you can output to "table.csv" as well as "table.txt". The only thing that matters is what you put into the files.

    If you read about Comma-separated values you'll see that it is mostly very easy, except for escaping commas in data by putting the whole field in quotes, and escaping quotes with double quotes.
    I might be wrong.

    Thank you, anon. You sure know how to recognize different types of trees from quite a long way away.
    Quoted more than 1000 times (I hope).

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. File transfer- the file sometimes not full transferred
    By shu_fei86 in forum C# Programming
    Replies: 13
    Last Post: 03-13-2009, 12:44 PM
  2. Totally confused on assigment using linked lists
    By Uchihanokonoha in forum C++ Programming
    Replies: 8
    Last Post: 01-05-2008, 03:49 PM
  3. help with text input
    By Alphawaves in forum C Programming
    Replies: 8
    Last Post: 04-08-2007, 04:54 PM
  4. Possible circular definition with singleton objects
    By techrolla in forum C++ Programming
    Replies: 3
    Last Post: 12-26-2004, 09:46 AM
  5. Simple File Creation Algorithm
    By muffin in forum C Programming
    Replies: 13
    Last Post: 08-24-2001, 03:28 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21