My file looks like:
19-04-05 08:45:22,643: INFO [ByrioThread] [] kks.connectorLog: Very important information
I want to cut it using a two character delimiter ": ", but with field definition "field 2 and all next". This would be a cut command as:
cut -f2- -d': '
so the output would be:
INFO [ByrioThread] [] kks.connectorLog: Very important information
however cut does not support multicharacter delimiter. Therefore answer given here How to use cut with multiple character delimiter? unix with awk does not work.
Any help appreciated!
This grep might work for you:
grep -Po ': \K.*' file
Or a pure bash solution using parameter expansion:
while IFS= read -r line; do
printf '%s\n' "${line#*: }"
done < file
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With