Hello,
I have a text file which has a column containing data like 0.0000, 3.7800, 67.0900, etc. I want to remove the trailing two zeros. How can I do this?
Thanks.
Find and replace
Moderators: AmigoJack, bbadmin, helios, MudGuard
- s_reynisson
- Posts: 939
- Joined: Tue May 06, 2003 1:59 pm
Using POSIX regular expression:
find ([0-9]+.[0-9]{2})[0-9]{2}
replace \1
HTH
edit: it would be safer to limit the search to the right of the decimal
comma, ie. if there is a space (_) there in your file you would use it like:
find ([0-9]+.[0-9]{2})[0-9]{2}_ and replace \1_
find ([0-9]+.[0-9]{2})[0-9]{2}
replace \1
HTH
edit: it would be safer to limit the search to the right of the decimal
comma, ie. if there is a space (_) there in your file you would use it like:
find ([0-9]+.[0-9]{2})[0-9]{2}_ and replace \1_
Then I open up and see
the person fumbling here is me
a different way to be
the person fumbling here is me
a different way to be
-
gajay
- Posts: 3
- Joined: Fri Dec 05, 2003 4:10 pm
Thanks for your help but it did not work. I am able to find the text with \.[0-9][0-9]00 but don't know how to remove the last two zeros.s_reynisson wrote:Using POSIX regular expression:
find ([0-9]+.[0-9]{2})[0-9]{2}
replace \1
HTH
edit: it would be safer to limit the search to the right of the decimal
comma, ie. if there is a space (_) there in your file you would use it like:
find ([0-9]+.[0-9]{2})[0-9]{2}_ and replace \1_
- s_reynisson
- Posts: 939
- Joined: Tue May 06, 2003 1:59 pm
Sorry for not being clear on this, goto Configure->Preferences->Editor
and tick the "Use POSIX regular expression syntax" box.
In the replace dialog tick the "Regular expression" box.
and tick the "Use POSIX regular expression syntax" box.
In the replace dialog tick the "Regular expression" box.
s_reynisson wrote:Using POSIX regular expression
Then I open up and see
the person fumbling here is me
a different way to be
the person fumbling here is me
a different way to be