Hi,
There's a bug using JavaDoc that generates an error if a tag <a...> is found in a javadoc comment, which is not a HTML reference. For example this error is produced with generics. I want to insert an space between "<" and "a". Expression is able to find where this happens using find and grep:
But i'm not able to generate the output expression. I don't know how keep the first part of expressi�n (until "<") add an space, and concatenate with the second part. For example, from:
To:
Just and a space between "List<" and "Almacen".
I'm trying to get all lines using above find command. Use cut -d "<" to separate parts, add an space and finally use sed to substitute in file. But I guess there must be an easy way using sed with regular expressions.
$ cat > AlmacenBo.java
* List<AlmacenOrdenacion>). Deber� pasar el id del recinto y el tipo de
$sed -i 's/List</List< /' AlmacenBo.java
$ cat AlmacenBo.java
* List< AlmacenOrdenacion>). Deber� pasar el id del recinto y el tipo de
I can't do that because it will replace all List<..> occurrences, and project won't compile.
Only javadoc comments where generic begins with an "A" must be replaced. It's there where bug makes javadoc fail.
I'll try, though I don't understand syntax...
Could be because of encoding charset? If I edit file with gedit I see words like "Deber�" correctly, but with sed (or cat) I see "Deber". It's Spanish and that must be without orthographic mistakes. If that is the problem, is there a way to say sed which is the encoding?
Thanks
---------- Post updated at 02:08 PM ---------- Previous update was at 01:28 PM ----------
I finally solved!!!
Just before running sed command, I use iconv to convert encoding from ISO-8859-1 to UTF-8. Then sed has no problems to replace.
That thing with printf and ex I got from a post from vgersh99; excellent thing to print the commands for ex, which has a syntax similar to sed etc. to instruct it what to do with the file. Glad you made it.