Re: Get specific data out of a memo field in a table
Originally posted by wavp
I have some data in a stored in a memo field in a table, for example:
How would I go about going making an array which will loop through each line of the data stored, so that I pick up specific data???
For memo fields, I've generally had to use string manipulation code to find things. One technique that I have used is to move through the text one word at a time looking for spaces, periods, line feed and carriage returns to help identify words and sentences. Then I add them to a collection or an array, as you mentioned, one word at a time. There are also other characters that you want to exclude from being part of a word such as commas and colens etc.
If you have a particular character such as the "@" in an Email address that you are looking for it gets a bit easier by using the InStr function and then just identify the spaces before and after the address to locate your word.
Having said all that, are you looking for code to do something like this or just syntax and language help with arrays?
I have a memo field that contains a large string of text with newline chars at the end of each line.
I am trying to figure out a way to analyze that string line by line.
one line might tell me that there was a miscount in the number of cartons, tell me the old number (54) and then tell me the number was corrected to (56).
I would like to be able to say something along these lines:
Search the string for a count of the number of times the word "carton" was found.
Because of the uniformity of the way the strings are brought into the memo field I know that the word "carton" for a typical error would be displayed twice - therefore I can take the count of the number of times "carton" was found, divide it by 2, and know the number of carton errors I had.
I understand code fairly well, but have not worked with it in a couple years so I do not know the best approach to take within access to accomplish this. I was thinking there would be some way to build an expression in the expression builder or a macro or module?? Also what is the common language used to interact with Access - VB? or can I use one of a few different languages?