F
fly_by_night
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!
Access module?
Any help is appreciated. thanks!
Peter said:But God help you if the Search and/or Replacement strings may include
1 or more CRLFs!!
Bas Cost Budde said:All except for that God doesn't write VBA. At least I never see Him
post on these fora...
Seriously, the InputLine part would need revision in that case.
Peter R. Fletcher said:The "if it's not too big" is potentially a very big "if".
The textbook way to do this, assuming that you do need to handle
included CRLFs and/or other control characters, _and_ that you need to
handle files of arbitrary (i.e. large!) size, would probably be to
open the file as binary, read it in fixed-length chunks, and
"double-buffer" the input in such a way that matches would be
guaranteed to be found even if they fall across block margins. The
details of the most efficient way of doing this would depend on your
scanning algorithm.
Dirk said:Fortunately, text files don't tend to be arbitrarily large.
The "if it's not too big" is potentially a very big "if".