I need to extract the characters before last colon : and also remove the square brackets [] in the last line.
My file structure is
256.XXX.XXX.X:20234
214.XXX.XXX.X:7249
[2200:XXXX:XXXX:XXX:XXXX:XXXX:XXXX:XXXX]:46288
I need output file as in the form of:
256.XXX.XXX.X
214.XXX.XXX.X
2200:XXXX:XXXX:XXX:XXXX:XXXX:XXXX:XXXX