943,650 Members | Top Members by Rank

Ad:
Apr 1st, 2006
0

Loading a .Dat into a Array of records help.

Expand Post »
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.
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
Red7 is offline Offline
2 posts
since Apr 2006
Apr 5th, 2006
0

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

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
Reputation Points: 28
Solved Threads: 4
Posting Whiz in Training
Lord Soth is offline Offline
233 posts
since Mar 2006
Apr 5th, 2006
0

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

Thanks, PM sent.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
Red7 is offline Offline
2 posts
since Apr 2006
Apr 21st, 2006
0

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

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
Reputation Points: 11
Solved Threads: 0
Light Poster
mrmike is offline Offline
41 posts
since May 2005

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Pascal and Delphi Forum Timeline: Making a Fullscreen form and hiding the Windows Taskbar
Next Thread in Pascal and Delphi Forum Timeline: Focussing last APP





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC