I am guessing I did not clarify vey well of what I wanted. Here is my issue.
I have a text file where the data is formatted with many blank spaces and
paragraph markers. Furthermore when the file is loaded into Access the entire
text file goes into a table with one field that is a MEMO field. The
Content of the fields looks similar to below
Thank you for listing your item with us. WE APPRECIATE YOUR BUISENSS
Below are your details
Listing Area – Somewhere USA
Check out our other specials
Remember: We offer competitive shipping an handling on all of our in
stock items
Your listing number is 2425342452343
Listing Name:
20004 Nissan
Price:
$26,000.00
With the above example I am trying to pull out the Listing Name. “2004
Nissanâ€, (Next time it might not be a 2004 Nissan. Next time it could be
anything so the 2004 is not a constant only the Listing Name: is a constant.
Also the space between the Listing Name: and the Name itself is not always
the same. So what I am doing is doing an Instr to get the # of characters to
Listing name: then adding 99 to the end of it. Below is my example
Dim IntTemp as integer
Dim strTemp as string
Dim IntTemp2 as integer
IntTemp=instr(Strin,â€Listing Name
![Smile :) :)](data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)
strTemp = mid(Strin,intemp,100) StrTemp Leaves me with this
strTemp= “ListingName: 2004 Nissan
From this point I want to get 2004 Nissan (or whatever name may appear in
subsequent txt files) to return.
Dilemma- With the number of spaces between Listing Name: and 2004 not being
constant, And the listing name not being constant how do I get the listing
name to return with this file and subsequent files?
IntTemp2 = instr(StrTemp,???) is my question
KARL DEWEY said:
Using this will return the position from the left that the first 'B' is to be
found in the string in the field.
Strtemp = Instr([YourField],"B")
To find a character looking from the right side use InStrRev in this way --
Strtemp = InstrRev([YourField],"B")
If string is 'Hi Bill how is your back today?' It would return 21
instead of 4.
AJOLSON said:
What would the code be to find the next character in a string
I have so far
Strtemp = instr(strin," ")
I just don’t know what to put between the " " to get the count to the next
character. No matter what the next character is.
Any help would be great.
Thanks