Hi all,
I have a text file with coordinate values as well as a height value.
Easting, Northing, Height
eg,
319773.76,6242000.07,18.74
319379.98,6242000.02,7.33
319422.22,6242000.00,4.43
After each of the decimal points I need to add an additional zero to make 3 decimal places. I can do it easy enough for the Easting and the Northing values, but can not find an answer to include the zero into the variable length "Height" value.
I have two thousand text files with about 200,000 lines in each of the text files
Can anyone see a scripting route I can take to fix my dilema.
Many thanks in advance.
I need to add aditional Numeral
Moderators: AmigoJack, bbadmin, helios, MudGuard
A regular expression I am sure would solve your problem easily, But a long hand method would be:
Record a macro.
Move the cursor to the start o the file (shft+ctrl+home).
Start recording the macro.
key sequence is "End", "0", "down arrow"
Save Macro.
Run macro to end of file.
Job done.
Lucky the first two coordinates are fixed length, but a regular expression would have been a more accurate method to do this and I am sure someone will provide the details for that.
Record a macro.
Move the cursor to the start o the file (shft+ctrl+home).
Start recording the macro.
key sequence is "End", "0", "down arrow"
Save Macro.
Run macro to end of file.
Job done.
Lucky the first two coordinates are fixed length, but a regular expression would have been a more accurate method to do this and I am sure someone will provide the details for that.
-
ben_josephs
- Posts: 2464
- Joined: Sun Mar 02, 2003 9:22 pm
You said you wanted the zero after the decimal point, thereby changing the values. This will do that:
Did you mean you wanted the zero after all the digits? This will do that:Find what: .
Replace with: .0
[ ] Regular expression [i.e., not selected]
Replace All
So will this:Find what: ([0-9]+\.[0-9]+)
Replace with: \10
[X] Regular expression
Replace All
These assume you are using Posix regular expression syntax:Find what: ([0-9])(,|$)
Replace with: \10\2
[X] Regular expression
Replace All
Configure | Preferences | Editor
[X] Use POSIX regular expression syntax