Community
    • Login

    Delete empty fields with notepad

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    5 Posts 3 Posters 1.1k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • zyllycarmyZ
      zyllycarmy
      last edited by zyllycarmy

      hello guys, I appeal to you, how could I eliminate those empty fields with notepad

      0.0.0.206 | P_01 = | firstname = johnny | day = | Happy Birthday = 15-02-1990 | city = | country = | client number = 890 | tuition number = | email:papomo@me.com |

      0.1230.209 | P_45 = 009 | firstname = val | day = 15 | Happy Birthday = | city = California | country = USA | client number = | tuition number = 8907 | email: |

      to

      0.0.0.209 | firstname = johnny | Happy Birthday = 15-02-1990 | client number = 890 | email:papomo@me.com |

      0.1230.209 | P_2 = 009 | firstname = val | day = 15 | Happy Birthday = | city = California | country = USA | tuition number = 8907 |

      Scott SumnerS 1 Reply Last reply Reply Quote 0
      • Terry RT
        Terry R
        last edited by Terry R

        @zyllycarmy
        I think your example went a bit awry as the results don’t exactly match the originals.i.e.
        0.0.0.206 becomes 0.0.0.209
        P_45 = 009 becomes P_2 = 009
        Happy Birthday = remains where your request was for this to be removed

        But if I read your request correctly you want any field having no data after the “=” sign is to be removed. Also any email field without an actual email address is also to be removed.

        So my regex (regular expression) is
        Find What:([^|]+?= \|)|\h*email: \|
        Replace With:<empty field> <—nothing in this field

        It will grab characters so long as a | is not found and followed by the = sign, a space and the | character. Alternatively it will find a space (optional, 0 or 1) followed by email: and another space and then the | character, thus no actual email address.

        See if this helps you. Come back to us regardless and let us know how you went and if you need further help.

        The regex needs the Replace function set as ‘regular expression’ search mode and have the ‘wrap around’ ticked.

        Terry

        zyllycarmyZ 1 Reply Last reply Reply Quote 1
        • Scott SumnerS
          Scott Sumner @zyllycarmy
          last edited by Scott Sumner

          @zyllycarmy

          Your example doesn’t really make sense…P_45 in the before text changes to P_2 in the after text, although that doesn’t fit the classification of “eliminate those empty fields”. And your IP address changes. And…Happy Birthday = remains in the after text although one would think it should be eliminated by the specification.

          1 Reply Last reply Reply Quote 0
          • zyllycarmyZ
            zyllycarmy @Terry R
            last edited by

            @Terry-R

            Excuse me, happy birthday should not be in the second line because it is empty without any data
            0.1230.209 | P_2 = 009 | firstname = val | day = 15 | city = California | country = USA | tuition number = 8907 |

            1 Reply Last reply Reply Quote 0
            • zyllycarmyZ
              zyllycarmy
              last edited by

              thank you very much helped me, sorry for the error, is that I’m with my baby taking care of it and working at the same time, solve the problem, thank you very much

              1 Reply Last reply Reply Quote 0
              • First post
                Last post
              The Community of users of the Notepad++ text editor.
              Powered by NodeBB | Contributors