Lew wrote:
> Kenneth P. Turvey wrote:
>> How would you replace the header comment in a collection of files
>> using NetBeans?
>
> Menu: Edit / "Replace in Projects" (Ctrl-Shift-H)
>
> replace regex
> (.*\n)*(package)
> with
> /* desiredstring */\npackage
>
And Eclipse is fundamentally the same thing, through Search > Files.
Once you indicate the file name pattern(s) and the scope of the search,
have set up the regular expression search pattern, and have run through
one search as a sanity check, there's a Replace button you can click to
enter a replace string.
With modern IDEs I see little reason to leave them to do a search &
replace on project files. However, I guess there are always edge cases.
On UNIX-based operating systems you can always fall back on
find/xargs/sed/awk/perl, and on Windows you've got PowerShell. NOTE:
can't remember about NetBeans, but if you make changes to project files
outside Eclipse, don't forget to refresh once you're back in the IDE.
AHS
|