Page 4 of 4 FirstFirst 1234
Results 46 to 56 of 56
  1. #46
    Join Date
    Aug 2005
    Location
    Cranbourne West
    Age
    72
    Posts
    3,612

    Default

    I did a copy and paste from your example in step 1.

    Here are some screen shots.


    1.jpg



    1a.jpg



    2.jpg



    2a.jpg
    To grow old is inevitable.... To grow up is optional

    Confidence, the feeling you have before you fully understand the situation.

    What could possibly go wrong.

  2. # ADS
    Google Adsense Advertisement
    Join Date
    Always
    Location
    Advertising world
    Age
    2010
    Posts
    Many





     
  3. #47
    Join Date
    Feb 2016
    Location
    Canberra
    Posts
    5,125

    Default

    Run the instruction from Post 37 first.

    Second, you've highlighted the section of text you want the process to search within. It wont find anything.... Select everything from the beginning (CTRL-A) or.... simply place the cursor at the beginning of the file.... (easier)

    (and delete all that garbage at the top!)


    See the problem here:
    oops.JPG

  4. #48
    Join Date
    Aug 2005
    Location
    Cranbourne West
    Age
    72
    Posts
    3,612

    Default

    I modified your expressions slightly
    Find: (\d{3}.\d{5})
    Replace: ,\1\r
    and ended up with this:

    1 MILE WATERHOLE,Waterhole,,-20.06327 ,137.02683(CR)
    1 XE MOUNTAIN,Mountain/Peak/Hill,,-17.75106 ,144.41183(CR)
    10 MILE CREEK,Watercourse,,-18.91145 ,128.28398(CR)
    10 MILE CREEK,Watercourse,,-20.41063 ,134.45267(CR)
    10 MILE CREEK,Watercourse,,-23.07116 ,149.18259(CR)
    12 MILE,Homestead,,-21.84802 ,149.14621(CR)

    The spaces at the beginning of the lines can easily be fixed as can the space before the comma separating the Lat Long coordinates.

    By the way 77,696 occurrences were replaced.

    I've got one more database to rework and with all the examples I've got here it should be a breeze.
    Once again thanks for all your help.
    To grow old is inevitable.... To grow up is optional

    Confidence, the feeling you have before you fully understand the situation.

    What could possibly go wrong.

  5. #49
    Join Date
    Aug 2005
    Location
    Cranbourne West
    Age
    72
    Posts
    3,612

    Default

    Quote Originally Posted by woodPixel View Post
    Run the instruction from Post 37 first.

    Second, you've highlighted the section of text you want the process to search within. It wont find anything.... Select everything from the beginning (CTRL-A) or.... simply place the cursor at the beginning of the file.... (easier)

    (and delete all that garbage at the top!)


    See the problem here:
    oops.JPG
    That highlight was after I ran the Find, it is the first occurrence.
    To grow old is inevitable.... To grow up is optional

    Confidence, the feeling you have before you fully understand the situation.

    What could possibly go wrong.

  6. #50
    Join Date
    Aug 2005
    Location
    Cranbourne West
    Age
    72
    Posts
    3,612

    Default

    Quote Originally Posted by woodPixel View Post
    Contrary to what I said 2 minutes ago about being impossible, I did it.

    Find values: (\d{5} \d{3}.\d{5} )
    replace values: \1\n
    I have started on the third data base and have modified find values equation to:

    (\d{3}.\d{5} )

    and the replace equation to:

    \1\r

    This places a CR at the end of the line and no spaces at the start of the next line.
    What does the \1 do? I have looked through all the expressions and can't find it.

    Regular Expressions - Notepad++ Wiki

    Okay, I had another look and found this:

    Backreference: \1 matches an additional occurence of a text matched by an earlier part of the regex. Example: This regular expression: ([Cc][Aa][Ss][Ee]).*\1 would match a line such as Case matches Case but not Case doesn't match cASE. A regex can have multiple subgroups, so \2, \3, etc can be used to match others (numbers advance left to right with the opening parenthesis of the group). So \n is a synonym for \gn, but doesn't support the extension syntax for the latter.

    I understand what's going on now
    To grow old is inevitable.... To grow up is optional

    Confidence, the feeling you have before you fully understand the situation.

    What could possibly go wrong.

  7. #51
    Join Date
    Feb 2016
    Location
    Canberra
    Posts
    5,125

    Default

    Regex is like Origami.

    One can be shown Step 1:"fold the paper in half" or Step 2:"then fold corner to corner".

    Easy you say!

    Then step 3 spontaneously turns it into a crane or crab, or some transmutation via the 5th dimension occurs.

    Whaaaaaatttt!!!!!!

    Its like that

    I warned you it will harm your DNA

  8. #52
    Join Date
    Aug 2005
    Location
    Cranbourne West
    Age
    72
    Posts
    3,612

    Default

    this expression worked fine for N/A

    If its litterally "N/A" the search replace would be "N/A\n" with ""

    i.e. in English: find N/A and newline character, then replace all of it with nothing.


    but is not working for OFFSHORE ROCK.

    Find: OFFSHORE ROCK\r

    offshore-rock.jpg
    To grow old is inevitable.... To grow up is optional

    Confidence, the feeling you have before you fully understand the situation.

    What could possibly go wrong.

  9. #53
    Join Date
    Feb 2016
    Location
    Canberra
    Posts
    5,125

    Default

    \r litterally means Return Carriage. \n is Newline. Text files may use either, or both. Depends on what operating system generated it.

    Your expression is looking for the string followed by a newline character, of which none exist. In your example the string is present followed by lots of spaces (or tabs. Hard to tell which)

    If you want to clear the hidden tabs the character is \t


  10. #54
    Join Date
    Aug 2005
    Location
    Cranbourne West
    Age
    72
    Posts
    3,612

    Default

    The CR has been generated with the \r command.
    They are spaces, not tabs between OFFSHORE ROCK and offshore rock.
    So, can I delete all lines containing OFFSHORE ROCK? Of course I can, just highlight all 5,876 lines and hit delete .
    To grow old is inevitable.... To grow up is optional

    Confidence, the feeling you have before you fully understand the situation.

    What could possibly go wrong.

  11. #55
    Join Date
    Feb 2016
    Location
    Canberra
    Posts
    5,125

    Default

    Sometimes one uses the broadsword, not the scalpel

  12. #56
    Join Date
    Aug 2005
    Location
    Cranbourne West
    Age
    72
    Posts
    3,612

    Default

    Third data base done, now to combine all three.
    The last one only took a couple of hours, better than the four days spent on the first one.
    To grow old is inevitable.... To grow up is optional

    Confidence, the feeling you have before you fully understand the situation.

    What could possibly go wrong.

Page 4 of 4 FirstFirst 1234

Similar Threads

  1. Micro-Macros
    By Ed Reiss in forum PHOTOGRAPHY
    Replies: 0
    Last Post: 3rd February 2013, 01:49 PM
  2. New Macros
    By Ed Reiss in forum PHOTOGRAPHY
    Replies: 4
    Last Post: 10th November 2011, 08:08 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •