Search This Blog

sed: replace formatted numbers

Example remove date string:
s="1234 2007-12-21 11:22:30 1.txt"
s=$(echo $s | sed 's/[0-9]\{4\}-[0-9]\{2\}-[0-9]\{2\}\s*//')
echo $s
# 1234 1.txt

No comments:

Post a Comment