Solved

Copying Lines From a File and Other

Posted on 1998-07-05
1
260 Views
Last Modified: 2013-11-22
I have a big file (It has about 1290 lines). I want to copy just some lines of the file in a RichEdit. How to do it so that it is fast? And how to do to seek quickly for a word in the file?
0
Comment
Question by:billbass
1 Comment
 
LVL 10

Accepted Solution

by:
Jacco earned 50 total points
ID: 1357121
To search a RichEdit see:

Q.10060068

If you want to search the RTF or TXT file you can use the following method:

1) Open the file
2) Read the entire file into a string usiong BlockRead
3) Use the POS function to find your text in this string

This is a very fast thing. If you want a case-insensitive search you can:

1) uppercase the searchstring
2) uppercase the entire text string
3) then use the POS function

To copy some lines of an RTF into a RicxhEdit can be a rather difficult task, because you have to determine the end of lines in the RTF with all the formatting commands inside it. I have the RTF specification but I think it is rather difficult to implement it correctly.

What you can do is loading the entire file in to a non-visible richedit. Copy the lines you want in your visible richedit to the clipboard and past them into the visible RichEdit.

Regards Jacco

good luck
0

Featured Post

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

773 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question