Checking File Format

This is a discussion on Checking File Format within the C++ Programming forums, part of the General Programming Boards category; How do I check if a text file havea required format ? eg. Format : <product number> <description> <price>...

  1. #1
    Registered User
    Join Date
    Mar 2004
    Posts
    10

    Checking File Format

    How do I check if a text file havea required format ?

    eg. Format :
    <product number> <description> <price>

  2. #2
    ...
    ... is offline
    Registered User
    Join Date
    Feb 2002
    Posts
    465
    if a file has to have a specific format such as the one you mentioned, i am assuming that you or your program are also the ones creating the file.

    in that case, you could write out a standard header that all files of this type have to have. when you read in the file, if the header fails then the file format is invalid.

    even if someone else is writing the file, if it is a text file you can require a certain header, but the only problem is all the people that are creating files of this type would need to know the format of the header.

    otherwise, the only thing you can do is read it in and hope...
    I came up with a cool phrase to put down here, but i forgot it...

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. help with text input
    By Alphawaves in forum C Programming
    Replies: 8
    Last Post: 04-08-2007, 05:54 PM
  2. Encryption program
    By zeiffelz in forum C Programming
    Replies: 1
    Last Post: 06-15-2005, 04:39 AM
  3. Simple File encryption
    By caroundw5h in forum C Programming
    Replies: 2
    Last Post: 10-13-2004, 11:51 PM
  4. archive format
    By Nor in forum A Brief History of Cprogramming.com
    Replies: 0
    Last Post: 08-05-2003, 08:01 PM

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