Keeping only A-Z . , in a text file

This is a discussion on Keeping only A-Z . , in a text file within the C Programming forums, part of the General Programming Boards category; Hi, im wanting to no, what is needed to remove all characters like $ from a text file, to ...

  1. #1
    Registered User
    Join Date
    Mar 2008
    Posts
    1

    Keeping only A-Z . , in a text file

    Hi, im wanting to no, what is needed to remove all characters like $ from a text file, to leave only normal letters remaining? Thanks.

  2. #2
    CSharpener vart's Avatar
    Join Date
    Oct 2006
    Location
    Rishon LeZion, Israel
    Posts
    6,471
    read file (for example usinf fgetc)
    check char - using isupper, or isalpha or other suitable function
    write char to the new file if it is ok
    delete the old file and rename the new file

    if file is not too big:
    read file (for example usinf fgetc)
    check char - using isupper, or isalpha or other suitable function
    add it to the buffer if condition passed

    when the whole file is processed - overwrite it with the buffer prepared
    The first 90% of a project takes 90% of the time,
    the last 10% takes the other 90% of the time.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Formatting the contents of a text file
    By dagorsul in forum C++ Programming
    Replies: 2
    Last Post: 04-29-2008, 12:36 PM
  2. struct question
    By caduardo21 in forum Windows Programming
    Replies: 5
    Last Post: 01-31-2005, 03:49 PM
  3. Simple File encryption
    By caroundw5h in forum C Programming
    Replies: 2
    Last Post: 10-13-2004, 10:51 PM
  4. checking values in a text file
    By darfader in forum C Programming
    Replies: 2
    Last Post: 09-24-2003, 02:13 AM
  5. what does this mean to you?
    By pkananen in forum C++ Programming
    Replies: 8
    Last Post: 02-04-2002, 02:58 PM

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