Thread: Tab issue when read file

  1. #1
    Registered User
    Join Date
    Nov 2007
    Posts
    2

    Question Tab issue when read file

    Hi, noob on board.

    I have some issues with the spliting data according to tab.

    What i need is to grab multiple inputs from a txt file and generate it into result txt file.

    the input file reads like;

    Johnny Bravo /tab S1234567
    Systems /tab/tab DT012
    VB /tab/tab DT234
    Adv Database /tab DT978
    .....


    I can understand if all data are seperated by 1 tab, but some of the infos in the txt file, such as some subjects taking by Johnny are tabbed more than once in the txt file depend on the text length, probably because of the alignment.

    Is there anyway for me to check for 1 or more tabs when getline()?

    Thanks.

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,661
    A for loop, and count them?
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  3. #3
    Registered User
    Join Date
    Nov 2007
    Posts
    2
    Yeah, something like that.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Newbie homework help
    By fossage in forum C Programming
    Replies: 3
    Last Post: 04-30-2009, 04:27 PM
  2. Can we have vector of vector?
    By ketu1 in forum C++ Programming
    Replies: 24
    Last Post: 01-03-2008, 05:02 AM
  3. Inventory records
    By jsbeckton in forum C Programming
    Replies: 23
    Last Post: 06-28-2007, 04:14 AM
  4. help with text input
    By Alphawaves in forum C Programming
    Replies: 8
    Last Post: 04-08-2007, 04:54 PM
  5. Game Pointer Trouble?
    By Drahcir in forum C Programming
    Replies: 8
    Last Post: 02-04-2006, 02:53 AM