472,783 Members | 981 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,783 software developers and data experts.

How to extract text line by line from TMemo?

62
Hi everyone,

I need to check for a substring in each line of a TMemo, how can I get each line separately?
I'm using this method now:
Expand|Select|Wrap|Line Numbers
  1.  int found;
  2.         for (int i=1; i<MemoLines; i++)
  3.         {
  4.                 String str = ShoppingBasketMemo->Lines->GetText();
  5.                 found = str.Pos(ProductNameForSearch);
  6.                 if (found!=0)
  7.                         ShoppingBasketMemo->Lines->Delete(i);
  8.  
But it is giving me all lines together into str, i can't separate them out.
Can't also find any function to do that. Does anyone know this?
Dec 11 '07 #1
1 4963
Savage
1,764 Expert 1GB
Hi everyone,

I need to check for a substring in each line of a TMemo, how can I get each line separately?
I'm using this method now:
Expand|Select|Wrap|Line Numbers
  1.  int found;
  2.         for (int i=1; i<MemoLines; i++)
  3.         {
  4.                 String str = ShoppingBasketMemo->Lines->GetText();
  5.                 found = str.Pos(ProductNameForSearch);
  6.                 if (found!=0)
  7.                         ShoppingBasketMemo->Lines->Delete(i);
  8.  
But it is giving me all lines together into str, i can't separate them out.
Can't also find any function to do that. Does anyone know this?
This is C++ builder,right?
If so,I believe that Lines are array of AnsiStrings,which means that by specifying it's index you could get ith line from the control.

Savage
Dec 29 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: questioner | last post by:
Hello everyone, I want to find text and extract a rest of line after the found line till line end. Does anyone know how to do this? Regards, P.S. My code looks like this so far: word =...
3
by: ano1optimist | last post by:
I've got the code to search through a directory for word documents, open the doc, search for specific text... but I'm trying to extract data that immediately follows the selected highlighted text. ...
9
by: Sharon | last post by:
hi, I want to extract a string from a file, if the file is like this: 1 This is the string 2 3 4 how could I extract the string, starting from the 10th position (i.e. "T") and...
4
by: Rafal 'Raf256' Maj | last post by:
jak znalezc dany string w TMemo (i przejsc do niego), jak przejsc (tzn odpowiednio przewinac scrollbary i ustawic kursor) do danej linii tekstu (np. numer 123) --...
8
by: nick | last post by:
Hi all can any one please tell me what is wrong in this code?? I'm new to deal with text files and extract data. i'm trying to look for data in a text file (3~4 pages) some lines start with a...
8
by: Fabian Braennstroem | last post by:
Hi, I would like to remove certain lines from a log files. I had some sed/awk scripts for this, but now, I want to use python with its re module for this task. Actually, I have two different...
9
by: flit | last post by:
Hello All, Using poplib in python I can extract only the headers using the .top, there is a way to extract only the message text without the headers? like remove the fields below: "...
0
by: napolpie | last post by:
DISCUSSION IN USER nappie writes: Hello, I'm Peter and I'm new in python codying and I'm using parsying to extract data from one meteo Arpege file. This file is long file and it's composed by...
5
by: Steve | last post by:
Hi all Does anybody please know a way to extract an Image from a pdf file and save it as a TIFF? I have used a scanner to scan documents which are then placed on a server, but I need to...
0
by: Rina0 | last post by:
Cybersecurity engineering is a specialized field that focuses on the design, development, and implementation of systems, processes, and technologies that protect against cyber threats and...
0
linyimin
by: linyimin | last post by:
Spring Startup Analyzer generates an interactive Spring application startup report that lets you understand what contributes to the application startup time and helps to optimize it. Support for...
0
by: erikbower65 | last post by:
Here's a concise step-by-step guide for manually installing IntelliJ IDEA: 1. Download: Visit the official JetBrains website and download the IntelliJ IDEA Community or Ultimate edition based on...
14
DJRhino1175
by: DJRhino1175 | last post by:
When I run this code I get an error, its Run-time error# 424 Object required...This is my first attempt at doing something like this. I test the entire code and it worked until I added this - If...
0
by: Rina0 | last post by:
I am looking for a Python code to find the longest common subsequence of two strings. I found this blog post that describes the length of longest common subsequence problem and provides a solution in...
5
by: DJRhino | last post by:
Private Sub CboDrawingID_BeforeUpdate(Cancel As Integer) If = 310029923 Or 310030138 Or 310030152 Or 310030346 Or 310030348 Or _ 310030356 Or 310030359 Or 310030362 Or...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
0
by: lllomh | last post by:
How does React native implement an English player?
0
by: Mushico | last post by:
How to calculate date of retirement from date of birth

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.