-94.1476, 36.3341,
-94.981617, 35.881339,
-94.22168, 36.36895,
-97.480064, 25.921765,
-104.6628, 38.23505,
This is a short section of hundreds of records in a large text file.
I want to add two zero's to the end of both sets of all numbers when the numbers only have four decimal places. -94.1476, will become -94.147600, and -104.6638 becomes -104.662800. i.e. I don't want to effect the numbers that already have six decimal places.
I really am having a hard time understanding how to work with numbers. Mostly with the Replace part of the Find/Replace.
If anyone can help, it will be really appreciated.
Thanks, Bob
Working with Numbers
Moderators: AmigoJack, bbadmin, helios, Bob Hansen, MudGuard
-
ben_josephs
- Posts: 2464
- Joined: Sun Mar 02, 2003 9:22 pm
More generally:
Alternatively,
These and MudGuard's solution assume you are using Posix regular expression syntax:
\< and \> are anchors; they match zero characters, but fix a position at the beginning or end (respectively) of a word (a digit sequence counts as a word).Find what: \<([0-9]{4})\>
Replace with: \100
[X] Regular expression
Alternatively,
That's \0 followed by 00. \0 represents whatever the whole regex matched.Find what: \<[0-9]{4}\>
Replace with: \000
[X] Regular expression
These and MudGuard's solution assume you are using Posix regular expression syntax:
Configure | Preferences | Editor
[X] Use POSIX regular expression syntax
-
ben_josephs
- Posts: 2464
- Joined: Sun Mar 02, 2003 9:22 pm