User Profile
Collapse
-
vgnadeau replied to How can I count the nmber of occurances of a word in a text file using Access VBA?in AccessYes, I have typos in my previous message. I think common sense will tell you what I meant. -
vgnadeau replied to How can I count the nmber of occurances of a word in a text file using Access VBA?in AccessWell ...
1) I did not know that I would have to 'cycle' until after I had originally posted my question. The XML file I was given was a sample. It's the sort of situation where if I ask the question I get the answer, if I don't then no one voluteers the info.
2) I was actually thinking about the usefulness of the answers for someone who was searching for a specific topic (Counting the number of occurances is not the same as find/replace)....Leave a comment:
-
vgnadeau replied to How can I count the nmber of occurances of a word in a text file using Access VBA?in AccessOk. Last problem of the day. Now I want to be able to repeat the cycle. I've counted the numner of occurances of "cb:TRINGLE " and divided the result by 4 to give me the number of times I need to repeat the Find/replace. So, I want to replace the first and fourth insances and then the first and fourth again ...
Example:
cb:MATERIAL
cb:TRINGLE
cb:TRINGLE
cb:MATERIAL
cb:MATERIAL
cb:TRINGLE...Leave a comment:
-
vgnadeau started a topic How can I count the nmber of occurances of a word in a text file using Access VBA?in AccessHow can I count the nmber of occurances of a word in a text file using Access VBA?
Hi. I would like to know how to count the number of occurances of a word in a text file.
I am using Microsoft Access VBA.
Any ideas? -
-
Ok. Here's my code now.
Code:Function FindAndReplaceXMLText() Dim sSearchText As String Dim sReplaceText As String Dim sFileName As String Dim strText As String Dim FirstPos, NextPos Dim intLength As Integer Dim i As Variant Dim inst(2) As Integer Const ForReading = 1 Const ForWriting = 2 sFileName = "C:\XMLtest\export.xml"
Leave a comment:
-
Now I get a compile error "Expected Array" on inst(1) = 1
Ignore this message. I was able to get rid of the compile error.Leave a comment:
-
Here's what I have for code now;
Code:Function FindAndReplaceXMLText() Dim sSearchText As String Dim sReplaceText As String Dim sFileName As String Dim strText As String Dim FirstPos, NextPos Dim inst As Integer Dim i As Integer Const ForReading = 1 Const ForWriting = 2
Leave a comment:
-
vgnadeau started a topic How can I find and replace only certain instances of a word in a text file ?in AccessHow can I find and replace only certain instances of a word in a text file ?
Hi. I am receiving an XML file that needs to be 'tweeked' before I can properly import it into to my Access database. I need to replace the first and fourth instance of'cb:TRINGLE'. I am able to replace the first instance of ‘cb:TRINGLE’ in the xml file. My problem now is that I do not want all instances to be replaced. I only want the first and fourth … In the following code you can see that I am able to locate the position of the fourth instance...
No activity results to display
Show More
Leave a comment: