Loading a .Dat into a Array of records help.

Reply

Join Date: Apr 2006
Posts: 2
Reputation: Red7 is an unknown quantity at this point 
Solved Threads: 0
Red7 Red7 is offline Offline
Newbie Poster

Loading a .Dat into a Array of records help.

 
0
  #1
Apr 1st, 2006
Hi there, I’m currently doing an assignment at University, I have been set a task that includes loading the contents of a .dat file into an array of records.

So far I’ve managed to get ‘something’ loaded into the array of records, but when this is displayed in a list box, a whole mess of stuff appears, mostly unreadable formatting.

I’m unsure if I’m slipping up loading the .dat into the array, (I have a funny feeling that the fields need to be aligned with how they are presented in the .dat?) or transferring the information from the array to the listbox, I assume it’s the former as I’m confident in the latter.

I don’t suppose theres any tutorials on the web detailing on how to do this, or if anyone can help me out on the forum?

I can provide the code snippets at a later date if its at all helpful, but general pointers would be preferable over a solution (you never know where the lecturers are ).

Thanks in advance for any help you can give me.
Reply With Quote Quick reply to this message  
Join Date: Mar 2006
Posts: 233
Reputation: Lord Soth is an unknown quantity at this point 
Solved Threads: 4
Lord Soth's Avatar
Lord Soth Lord Soth is offline Offline
Posting Whiz in Training

Re: Loading a .Dat into a Array of records help.

 
0
  #2
Apr 5th, 2006
Hi,

There is no standarts specification or .dat extension so it is hard to tell anything without seeing their contents but you have to parse the data from .dat to your records. I can help you more if you send me a sample .dat file but most likely each record is delimited by a CRLF (#13#10) in your .dat file and each field is delimited by tab, space, comma, semi colon, pipe (|) or something similar. You can google CSV parsing on Delphi.

Loren Soth
Reply With Quote Quick reply to this message  
Join Date: Apr 2006
Posts: 2
Reputation: Red7 is an unknown quantity at this point 
Solved Threads: 0
Red7 Red7 is offline Offline
Newbie Poster

Re: Loading a .Dat into a Array of records help.

 
0
  #3
Apr 5th, 2006
Thanks, PM sent.
Reply With Quote Quick reply to this message  
Join Date: May 2005
Posts: 41
Reputation: mrmike is an unknown quantity at this point 
Solved Threads: 0
mrmike mrmike is offline Offline
Light Poster

Re: Loading a .Dat into a Array of records help.

 
0
  #4
Apr 21st, 2006
I do have a delphi routine, that I wrote inconjunction with a friend a while back that can take an ini file and convert it to a .dat file format and encrypts the data (simple encryption)

when run it checks for an ini file which may contain any new or updated information and then modifies the dat file accordingly. if the ini file is not found it just uses the dat file.

it doesn't have the ability to update the records at moment, but could possibly be modified to do that

each record in the ini file is '~' delimitated

let me know if need some code snippet
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC