?
Solved

Copying Lines From a File and Other

Posted on 1998-07-05
1
Medium Priority
?
265 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 10

Accepted Solution

by:
Jacco earned 100 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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
Suggested Courses
Course of the Month12 days, 19 hours left to enroll

777 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