Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations MikeeOK on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Printing *.dat files

Status
Not open for further replies.

akajoe3068

Programmer
Jun 1, 2006
1
GB
Hi there, I hope someone can help. I've created an application that stores all my contacts from information entered in TEdits and TMemos and then writes this info to a "records.dat" file. My question is how do I print this information in a legible way, because opening the dat file in notepad gives you alot of un-readable characters. I need to print either one contact or all of them. Is there anyway of converting this dat file to be imported into Excel or the like. Any help will be appericated.
 
If you use the 'plain text' attribute of a richedit you should just get the text. But there should not be a problem with a standard memo component.
How are you writing the file, the simplest way to achieve this is to transfer the text into a TStringList and use the 'SaveToFile' method to create the file, again this usually results in clean text file
If you make 'comma separated' text fields then you can import into Excel without much problem.
You might also find the 'trim(string)' function useful to get rid of unwanted control chars.


Steve: Delphi a feersum engin indeed.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top