[Year 12 SofDev] Working with CSV text files

Travis Parker Travis.Parker at beaconhills.vic.edu.au
Fri Aug 26 09:40:31 EST 2011


Dear All,

I am halfway through a program with my Year 12 SD class that writes to a
text file (Comma separated) and allows them to add and delete records
from it (Using similar techniques to Adrian Janson's "Hi-scores table"
in his great "VB.net for education" book). I have included many
validation techniques, including range checking for a person's age (They
must be a uni student so this is a bit controversial, particularly about
mature age students!), existence checking for names, and data type
checking for numbers (They must enter numbers only for phone numbers -
Not necessarily correct in real life but just using it as an example). 

I have also created a funky little program that validates email
addresses (Attached as a zip file). It makes sure that it follows a
logical structure, including containing the "@" symbol and a ".com" or
equivalent at the end. Students incorporate this code into their
validation of user entries as well.

One thing that I am doing at the moment though is looking at editing
individual records. I have tried numerous methods using past code for
CSV files, and ideally I would have the user select a record (Displayed
in a listbox) and click btnEdit, then the program would read each field
back into the original textbox that it was entered (i.e. Their name is
read back into the text property of txtName). So far all I can manage is
having it read the entire text file back into a multiline textbox and
allow the user to edit it there, then save or discard the changes. This
works, but is more prone to human error and I would like a better way of
doing things.

If anyone can help or is facing a similar issue it would be great if you
could give me some idea of what to do here.

Many thanks

Trav


-------------- next part --------------
A non-text attachment was scrubbed...
Name: Email address validation.zip
Type: application/x-zip-compressed
Size: 76585 bytes
Desc: Email address validation.zip
Url : http://www.edulists.com.au/pipermail/sofdev/attachments/20110826/b11c70f3/Emailaddressvalidation-0001.zip 


More information about the sofdev mailing list