Thread: Comma delimited text sorting, advice?

  1. #1
    Registered User
    Join Date
    Apr 2011
    Posts
    1

    Comma delimited text sorting, advice?

    Hello,
    i'm working on an assignment for school.
    i'm doing in visual c++ using borland.
    i have a requirement to do the following:
    1. Load Given a txt file which has a number of records (not specified) of student IDs and their date of enrollment.
    2. Ability to filter Students by their ID
    3. Ability to filter Students by Date of enrollment
    4. Show the filtered result.
    Below is an example of one line of the mentioned text file:
    //Student ID, Date Enrolled,Name Abreviation
    01368,2010-11-29,Ru88

    What i've done so far:

    1. Created visually the needed setup as such:

    i. ComboBox (contains Student IDs, which i've added manually)
    ii. DateTimePicker (added two with name: From and To)
    iii. RadioButton (Labeled as ALL records, DATEdResult( which will set the DATETimePIcker to enabled and visible to show a specific date)
    iV. StringGrid.
    v. main menu with open dialog.

    What i need advice with:

    1. how can i load the text file in a way that i can take the comma as a delimiter. in other words, how can i sort by date (given that date is the second field.

    3. am i correct to use stringgrid? would a memo be better suited for just showing the output?

    Thank you for you advice in advance.

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,659
    Some days, it's just too hard to bother even reading forums without seeing the same thing over and over again.
    Newbie,comma Delimited Text File Parsed And Sorted Problem - C And C++ | Dream.In.Code

    Anyone would think this were broadcast commercial news....

    How To Ask Questions The Smart Way
    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
    Apr 2010
    Posts
    8
    thank you for the helpful reply that helps me with the problem i'm facing.

    anyhow, even though i've actually posted two threads.
    i've done so in two different and completely separate forums.
    unless dreamincode is a subdomain of cprogramming i don't see the what's the big deal as i'm not duplicating threads.

    Quote Originally Posted by Salem View Post
    Some days, it's just too hard to bother even reading forums without seeing the same thing over and over again.
    Newbie,comma Delimited Text File Parsed And Sorted Problem - C And C++ | Dream.In.Code

    Anyone would think this were broadcast commercial news....

    How To Ask Questions The Smart Way

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Simple comma delimited text file
    By zeebo17 in forum C Programming
    Replies: 10
    Last Post: 06-23-2010, 08:05 AM
  2. Comma delimited File
    By Coding in forum C++ Programming
    Replies: 5
    Last Post: 09-29-2008, 03:53 PM
  3. Extract Elements From a Comma Delimited String
    By chris.zeman in forum C++ Programming
    Replies: 4
    Last Post: 11-14-2006, 11:12 AM
  4. writing double quote & comma delimited files
    By emt in forum C++ Programming
    Replies: 5
    Last Post: 06-30-2003, 12:28 AM
  5. quoted-comma-delimited files
    By my68gto in forum C++ Programming
    Replies: 4
    Last Post: 08-03-2002, 01:48 PM