@vgersh99
You always cut the last 5 characters, no matter if he needs 4 or 6 like in the other rows.
@Franklin52
Yep, that's true. You have to know the possibilties of your file-to-be-parsed very well to limit the chances of unwanted behaviour.
So for the input presented we can say that when at least 5 zeros are in a row, that we can use them to separate the last digits we want:
Code:
sed 's/.*00000\([^0]*\)/\1/'
This will at least make sure, that even if you have 1 up to 4 zero in your last digits, the will be separated ie. parsed correctly. If you have at the end a "600000", you have a problem again. For this I don't have a good solution, as I just thought, that there at least a number of zeros following each other before the last digits come, you want.
If you know that the last digits are always not more than 6 digits, you can parse them like vgersh99 did, ie. add a dot or write it another way and after that cut off all leading zeros.
EDIT: @vgersh99
Oh you saw it already while I was writing
