Hi,
I am curiuos to find out if it is possible to find string lines in a
java file:
public static final String <Variable name with all caps> = ;
and replace it with:
public static final String <Variable name with all caps> = "";
Is there a way to replace lines looking like the first line with the
last line. The name before equal sign is different for each line.
I am thinking of using a shell script or regexp in java 1.4 (That is why
I post in two places).
Regards,
//Mikael
Ed Morton - 28 Sep 2003 17:20 GMT
> Hi,
>
[quoted text clipped - 16 lines]
>
> //Mikael
Pretty trivial with sed:
sed 's/^\(public static final String [A-Z0-9_]* = \);/\1"";/' filename.java
I'm assuming your variable name can include digits and underscores as
well as being all upper-case letters.
Regards,
Ed.