J
Jasmin Bajric
Hi together,
I have a little VBA problem but can not solve it -- perhaps you have an
idea?
The problem:
I have a long txt-file in which I want to search for a specific word and
want to replace it with an other one. The simple search/replace command does
not work, because the specific word should be replaced *only* if it occurs
in specific case.
Here one part of the long txt-file:
---snipp
\subsubsection*{-ed and -ing}
Si quaedam nimis antique, si peraque dure dicere credit eos, ignave multa
fatetur, et sapit et mecum facit et Iova iudicat aequo. Non equidem insector
delendave carmina Livi esse reor, memini quae plagosum mihi parvo Orbilium
dictare; sed emendata videri pulchraque et exactis minimum distantia miror.
\subsubsection*{-fuls and -ful}
Si quaedam nimis antique, si peraque dure dicere credit eos, ignave multa
fatetur, et sapit et mecum facit et Iova iudicat aequo. Non equidem insector
delendave carmina Livi esse reor, memini quae plagosum mihi parvo Orbilium
dictare; sed emendata videri pulchraque et exactis minimum distantia miror.
\subsubsection*{-ic}
Si quaedam nimis antique, si peraque dure dicere credit eos, ignave multa
fatetur, et sapit et mecum facit et Iova iudicat aequo. Non equidem insector
delendave carmina Livi esse reor, memini quae plagosum mihi parvo Orbilium
dictare; sed emendata videri pulchraque et exactis minimum distantia miror.
\subsubsection*{-wise}
Si quaedam nimis antique, si peraque dure dicere credit eos, ignave multa
fatetur, et sapit et mecum facit et Iova iudicat aequo. Non equidem insector
delendave carmina Livi esse reor, memini quae plagosum mihi parvo Orbilium
dictare; sed emendata videri pulchraque et exactis minimum distantia miror.
---snipp
The VB-program:
The program should search the complete file for the expression
"\subsubsection*{".
If this expression is found, it should search in the same line for the word
"and" and should replace it with an other word (like "blabla").
It is important to see, that the "and" is only to be replaced, if it occurs
in the very same line as the expression"\subsection*{" - not in the
following text lines.
Do you think this is possible with VBA? Do you have an idea?
Thanks a lot in advance
Regards
Jasmin
I have a little VBA problem but can not solve it -- perhaps you have an
idea?
The problem:
I have a long txt-file in which I want to search for a specific word and
want to replace it with an other one. The simple search/replace command does
not work, because the specific word should be replaced *only* if it occurs
in specific case.
Here one part of the long txt-file:
---snipp
\subsubsection*{-ed and -ing}
Si quaedam nimis antique, si peraque dure dicere credit eos, ignave multa
fatetur, et sapit et mecum facit et Iova iudicat aequo. Non equidem insector
delendave carmina Livi esse reor, memini quae plagosum mihi parvo Orbilium
dictare; sed emendata videri pulchraque et exactis minimum distantia miror.
\subsubsection*{-fuls and -ful}
Si quaedam nimis antique, si peraque dure dicere credit eos, ignave multa
fatetur, et sapit et mecum facit et Iova iudicat aequo. Non equidem insector
delendave carmina Livi esse reor, memini quae plagosum mihi parvo Orbilium
dictare; sed emendata videri pulchraque et exactis minimum distantia miror.
\subsubsection*{-ic}
Si quaedam nimis antique, si peraque dure dicere credit eos, ignave multa
fatetur, et sapit et mecum facit et Iova iudicat aequo. Non equidem insector
delendave carmina Livi esse reor, memini quae plagosum mihi parvo Orbilium
dictare; sed emendata videri pulchraque et exactis minimum distantia miror.
\subsubsection*{-wise}
Si quaedam nimis antique, si peraque dure dicere credit eos, ignave multa
fatetur, et sapit et mecum facit et Iova iudicat aequo. Non equidem insector
delendave carmina Livi esse reor, memini quae plagosum mihi parvo Orbilium
dictare; sed emendata videri pulchraque et exactis minimum distantia miror.
---snipp
The VB-program:
The program should search the complete file for the expression
"\subsubsection*{".
If this expression is found, it should search in the same line for the word
"and" and should replace it with an other word (like "blabla").
It is important to see, that the "and" is only to be replaced, if it occurs
in the very same line as the expression"\subsection*{" - not in the
following text lines.
Do you think this is possible with VBA? Do you have an idea?
Thanks a lot in advance
Regards
Jasmin