Re: search and replace text in text file from access

Tech-Archive recommends: Fix windows errors by optimizing your registry

From: Allen Browne (AllenBrowne_at_SeeSig.Invalid)
Date: 12/04/04


Date: Sat, 4 Dec 2004 11:58:45 +0800

The safe way to do this with pure VBA would be:
- Open the file for input
- Open a temp file for output
- InputLine
- Replace()
- Print #
- Loop until EOF
- Close both
- Kill the orginal
- Name the 2nd as the first.

-- 
Allen Browne - Microsoft MVP.  Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.
"fly_by_night" <fly_by_night@discussions.microsoft.com> wrote in message
news:71B1B11F-E800-4731-92DA-4EF5EFFA5BC7@microsoft.com...
> Is there a way to search and replace a piece of text in a text file from 
> an
> Access module?
>
> Any help is appreciated. thanks! 


Relevant Pages

  • Re: search and replace text in text file from access
    ... >- Open a temp file for output ... >- InputLine ... >- Loop until EOF ...
    (microsoft.public.access.modulesdaovba)
  • Re: Convert string to code
    ... It contains dependent values, ... Tips for Access users - http://allenbrowne.com/tips.html ... In other words, loop through the records, look at the calculation, do the ...
    (microsoft.public.access.modulesdaovba)
  • Re: How to queryvery many conditions in VBA
    ... Tips for Access users - http://allenbrowne.com/tips.html ... Another idea is to code a loop where each iteration executes an append query for each ID. ...
    (microsoft.public.access.queries)
  • Re: Add an Index to all fields
    ... You will also need to know how to loop through the Fields of the TableDef: ... Tips for Access users - http://allenbrowne.com/tips.html ... fields in a table using VBA code, ...
    (microsoft.public.access.modulesdaovba)
  • Re: code to match and update records
    ... An Update query would be much more efficient than t loop: ... Tips for Access users - http://allenbrowne.com/tips.html ... "Joel" wrote in message ... > I would like to Loop through records in Table1, ...
    (microsoft.public.access.modulesdaovba)