I have a java file in which I have the below line with the CRLF
at the end of the Logger.
private static final Logger logger = LoggerCRLF
.getLogger(MyClass.class);
What I want to do is to remove the CRLF just when it is after Logger in my file and join the line into one line as shown below. This should not affect other CRLFs in my file.
private static final Logger logger = Logger.getLogger(MyClass.class);
I tried the below command to do it
find . -name *.java -exec sed -i 's/Logger\r\n//g' {} \;
but I realized that SED reads one line at a time without trailing newline characters so this is not working. From the man page I was able to find few commands such as N, P and D but I could not make it work.
So the question is how can I remove one CRLF based on the preceding pattern in a file?