Solved

Copying Lines From a File and Other

Posted on 1998-07-05
1
259 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
In this video I am going to show you how to back up and restore Office 365 mailboxes using CodeTwo Backup for Office 365. Learn more about the tool used in this video here: http://www.codetwo.com/backup-for-office-365/ (http://www.codetwo.com/ba…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

895 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now