For example, I might want to:
tail -f logfile | grep org.springframework | <command to remove first N characters>
I was thinking that 'tr' might have the ability to do this but I'm not sure.
Thanks in advance stackoverflow geniuses!
-- LES
For example, I might want to:
tail -f logfile | grep org.springframework | <command to remove first N characters>
I was thinking that 'tr' might have the ability to do this but I'm not sure.
Thanks in advance stackoverflow geniuses!
-- LES
cut' WORKS!
tail -f logfile | grep org.springframework | cut -c 900-
would remove the first 900 characters
'cut' uses 900- to show the 900th character to the end of the line
however
when i pipe all of this through grep i don't get anything :(
Use cut
. Eg. to strip the first 4 characters of each line (i.e. start on the 5th char):
tail -f logfile | grep org.springframework | cut -c 5-
sed 's/^.\{5\}//' logfile
and you replace 5 by the number you want...it should do the trick...
EDIT
if for each line
sed 's/^.\{5\}//g' logfile