Need Help to with FILE in C

This is a discussion on Need Help to with FILE in C within the C Programming forums, part of the General Programming Boards category; Hi, My requirment is i want to remove the extra comma from the last char of last line of FILE. ...

  1. #1
    Registered User
    Join Date
    Feb 2006
    Posts
    22

    Need Help to with FILE in C

    Hi,
    My requirment is i want to remove the extra comma from the last char of last line of FILE.
    that file is open into write mode. basically that file is making a control file for SQL loader.So, there is one condition for that where i have to remove one extra comma at the end of file.

    Please let me know, if anyone have any idea.
    how to achieve this.

    THanks in Advance.

    Anwar

  2. #2
    ATH0 quzah's Avatar
    Join Date
    Oct 2001
    Posts
    14,826
    How about posting your thoughts on the matter? I don't see anything even remotely trying to put any effort into this.


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

  3. #3
    Frequently Quite Prolix dwks's Avatar
    Join Date
    Apr 2005
    Location
    Canada
    Posts
    8,046
    that file is open into write mode.
    Well, you'll have to open the file for reading (or reading and writing) if you intend to do what you're attempting.

    Look up fgets() and strrchr().
    dwk

    Seek and ye shall find. quaere et invenies.

    "Simplicity does not precede complexity, but follows it." -- Alan Perlis
    "Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
    "The only real mistake is the one from which we learn nothing." -- John Powell


    Other boards: DaniWeb, TPS
    Unofficial Wiki FAQ: cpwiki.sf.net

    My website: http://dwks.theprogrammingsite.com/
    Projects: codeform, xuni, atlantis, nort, etc.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. sequential file program
    By needhelpbad in forum C Programming
    Replies: 80
    Last Post: 06-08-2008, 01:04 PM
  2. Unknown Memory Leak in Init() Function
    By CodeHacker in forum Windows Programming
    Replies: 3
    Last Post: 07-09-2004, 09:54 AM
  3. Making a LIB file from a DEF file for a DLL
    By JMPACS in forum C++ Programming
    Replies: 0
    Last Post: 08-02-2003, 08:19 PM
  4. Hmm....help me take a look at this: File Encryptor
    By heljy in forum C Programming
    Replies: 3
    Last Post: 03-23-2002, 09:57 AM
  5. Need a suggestion on a school project..
    By Screwz Luse in forum C Programming
    Replies: 5
    Last Post: 11-27-2001, 01:58 AM

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