Thread: Need Help to with FILE in C

  1. #1
    Registered User
    Join Date
    Feb 2006

    Need Help to with FILE in C

    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.


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

    Hope is the first step on the road to disappointment.

  3. #3
    Frequently Quite Prolix dwks's Avatar
    Join Date
    Apr 2005
    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().

    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:

    My website:
    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. me take a look at this: File Encryptor
    By heljy in forum C Programming
    Replies: 3
    Last Post: 03-23-2002, 10:57 AM
  5. Need a suggestion on a school project..
    By Screwz Luse in forum C Programming
    Replies: 5
    Last Post: 11-27-2001, 02:58 AM