Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Searching in a big memo-field for a special info. 1

Status
Not open for further replies.

german12

Programmer
Nov 12, 2001
563
DE
I haven't worked with memo fields in VFP for a very long time.
Every week I get a magazine with stock market information, and
before I throw them away after having read them, I can save their text-contents in a memo field.
Such a memo field can then hold the text of around 150 pages per magazine, which is then around 13,000 m-lines of content in a memo field.
Of course I don't want to read everything, I just want to place a keyword and then - let's say - read the next 5 lines when that keyword had been found in the memo-field.
Example:
Keyword = “IBM”
Then there should be 5 lines displayed in a text box, or an edit box or in a cursor
contain "IBM" and a litte bit more information.
Now, of course, "IBM" may have been mentioned several times in the newspaper.
Then it would be nice if you could see the following 5 lines in the cursor after the first search in the cursor.
(Namely when the search term “IBM” was found again.)
So the memo field would have to be searched completely but only
a few lines to be defined are displayed.

Thank you for your help in advance.
Klaus

Peace worldwide - it starts here...
 


This is particularly the case in a stock market magazine such as this one.

The choice of search words is almost always the name of a company to find out their situation, plannings, course development etc.
I'll take a closer look at the text soon and hope to find hidden signs somewhere that indicate a change in topic or the end of a page or column etc.

Notepad++ can also help me with this, as it provides several options for displaying the text - such as an HTML view...

Thank you for the many options to search for you mentioned

I'll get back.
Regards
Klaus




Peace worldwide - it starts here...
 
I have created a *.dbf file (corplook1.dbf) which has a character-field "company".
The file is not yet indexed.
Now I created a form with a listbox control - and filled that listbox (List1) on the form with properties as follows:

RowSource:
Select distinct company from corplook1 order by company
RowSourceType:
3 - SQL Statement

That works - Listbox1 is filled with the extracted companies in alphabetical order.
Now I can click....but how can I use that clicked name of the company to proceed (eg. to find more about it in a memofield?)

Possible ?, or do I have to transfer the *.dbf into an array/cursor to identify the contents by item before?







Peace worldwide - it starts here...
 
To answer in very short:
listbox.listindex: Number of the selected item,
listbox.listitem(listbox.listindex): value = compny name.

I would also consider you start a new thread, even if it's still all about these Memos with texts of magazines.
The question is about how to address a listbox and that could be interesting to future readers also, and thus is always a good reason to start a new thread.

Well, besides that, as companies are that important to you, I wonder why you need your query
Select distinct company from corplook1 order by company

Why don't you already have a table with companies. It's not a good strategy to get such a list by condensing data from a table where company names appear repeatedly. Every company would get an id and ever further detail data about it would only refer to the company name by that id. Which also means every time you find the company name in a text and can determine it is that company, it can be addded as one of perhaps many detail data tables about companies, company stock exchange data, comany articles and whatever else. Structure your data and you never need a query like that. Especially once you identify you'd like to have such a list, don't just say it costs no time to get it from the data you already have, extract the data you repeatedly need into their own tables.

Chriss
 
Hi Chriss,
first of all - thank you very much for your quick answer about adressing a listbox.


a) I asked myself before whether it should be a separate thread.
As my decision was not the best one ( I agree with your argument now) - I suggest to repeat that again in a new thread and you put your replies again there.
Is that ok?

b)Your suggestion to use a file with companies is also ok.
But...I need a list of worldwide information - and so far I haven't found anything like that on the Internet.
It would be a list that would have approximately 65,000 entries.

Maybe someone here knows where I can find such a list....which can also be easily transferred to a *.dbf.

You can get such lists organized by country, but it would be very time-consuming to get this information from each country
into a *.dbf file, because that's a lot of pages

Maybe I can find another list

The stock market magazine that I subscribe to has a table of contents with the respective reports, which companies are discussed in an issue together with the corresponding page number, which is why I have copied this information out - eliminated the page number using the program and put it into a *.dbf transferred and with the command "distinct"
I hoped that over time I would create a better and better file in which a company would only appear once.

But your idea is better, because then you wouldn't have to do this drag and drop procedure for every issue.

Regards
Klaus




Peace worldwide - it starts here...
 
I'm fine with repeating answers, so just start a new thread, or two, one about the listbox question, another topic I see from this discussion is how to get to a companies.dbf file. And while the listbox should list the companies, that's still two separate challenges.

Chriss
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top