I've got a complex sed command written that doesn't seem to be working correctly. I don't see anything wrong with it but it's not formatting the way it should it seems and it's pulled numbers out of nowhere. Command as is:
Code:
sed -e "s/\([1-9]*\)\(.\)\([1-9]*\)\(.\)\([1-9]*\)\(,\)\([1-9]*\)\(.\)\([a-z]*\)\(,\)\([1-9]*\)/\1\2\3\4\5 \7 \9 \11/" tmp >> diskhog
file before:
1 000-0001,85246708 user,37062956
2 000-0002,39100916 user,15359912
3 000-0003,46756052 user,95710112
4 000-0004,19719784 user,28267676
5 000-0005,22113236 user,11721556
file after:
Code:
1 000-0001,85246708 user,37062956
2 000-0002,39100916 user,15359912
3 000-0003,46756052 user,95710112
4 000-0004 19719784 user 3481
5 000-0005 22113236 user 3481
seems to not be touching the first three lines at all and pulling "3481" out of nowhere. Any ideas what's going on/help/better ideas than such a complex sed?