Hi I have a file with a lot of bad data lines. I've identified the lines with bad data. The file is very big that it cant be done manually. The problem may reoccur in future so I'm writing a small tool in java to remove the bad segments based on a input regex and remove it.
An example of Bad data is
ABC*HIK*UG*XY\17
I'm trying to write a regex for the above string. So far
Only "(^ABC)"
works and ABC is removed.
When I use this nothing happens.
"(^ABC*.XY\17$)"
Please give your inputs.
EDITED:
The answer is working perfect but
If my input files contains this
ABC
123
ABC*HIK*UG*XY\17
1025
KHJ*YU*789
I should get output like
ABC
123
1025
KHJ*YU*789
but I'm getting like this
ABC
123
1025
KHJ*YU*789