473,320 Members | 1,857 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 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 5000
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: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

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.