Solved

Copying Lines From a File and Other

Posted on 1998-07-05
1
258 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
Comment Utility
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

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Windows Drag & Drop Location 2 85
Master Detail with TADODataset 4 96
Thread safe  opinion 7 109
Downloading email attachments 2 54
Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
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…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

744 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

12 Experts available now in Live!

Get 1:1 Help Now