Thread: newbie seeks help

  1. #1
    Unregistered
    Guest

    newbie seeks help

    I am wanting to change a text file to a csv file,it is on a unix box if thats any help,at the moment I print out the txt file but want to export it to ms access,any help would be appreciated

  2. #2
    Code Goddess Prelude's Avatar
    Join Date
    Sep 2001
    Posts
    9,897
    >I am wanting to change a text file to a csv file
    Replace the spaces delimiting fields with commas. If you want to go further then search google for common CSV standards and reformat your file accordingly.

    -Prelude
    My best code is written with the delete key.

  3. #3
    ATH0 quzah's Avatar
    Join Date
    Oct 2001
    Posts
    14,826
    > I am wanting to change a text file to a csv file

    Code:
    #include <stdio.h>
    int main ( int argc, char **argv )
    {
        char buf[1024]={0};
    
        sprintf( buf, "%s.cvs", argv[1] );
        if ( !rename( argv[1], buf ) )
            printf("Ok, '%s' is now a .cvs file. :D\n", argv[1] );
        else
            printf("'%s' could not be renamed.\n", argv[1] );
        return 0;
    }


    Quzah.
    Hope is the first step on the road to disappointment.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. newbie: array question :(
    By cstudent in forum C Programming
    Replies: 2
    Last Post: 04-09-2008, 06:46 AM
  2. Newbie in problem with looping
    By nrain in forum C Programming
    Replies: 6
    Last Post: 11-05-2005, 12:53 PM
  3. Some help for a newbie?
    By Ilmater in forum C++ Programming
    Replies: 23
    Last Post: 04-19-2004, 07:44 PM
  4. C++ newbie / linux not so newbie question
    By goldmonkey in forum C++ Programming
    Replies: 7
    Last Post: 12-13-2003, 12:27 PM
  5. Newbie Game Develpoers Unite!
    By Telenosis in forum Game Programming
    Replies: 10
    Last Post: 06-22-2002, 02:02 PM