Tapatalk

Delete end of line at the xth specific character

Delete end of line at the xth specific character

3
NewbieNewbie
3

    Feb 24, 2006#1

    Hello i would like to delete the end of each line after the second "," (coma) and write this : "'Allemagne');"

    For example,

    BEFORE :

    Code: Select all

    INSERT INTO zipcodes VALUES (01067,'Dresden','SN',13.7210676148814,51.0600336463379,1,1,'de');
    INSERT INTO zipcodes VALUES (01069,'Dresden','SN',13.7389066401609,51.039558876083,1,1,'de');
    INSERT INTO zipcodes VALUES (01097,'Dresden','SN',13.7439674110642,51.0667452412037,1,1,'de');
    
    AFTER :

    Code: Select all

    INSERT INTO zipcodes VALUES (01067,'Dresden','Allemagne');
    INSERT INTO zipcodes VALUES (01069,'Dresden','Allemagne');
    INSERT INTO zipcodes VALUES (01097,'Dresden','Allemagne');
    
    I tried :

    Code: Select all

    ColumnModeOff
    HexOff
    UnixReOff
    Find RegExp ","
    Find RegExp ","
    EndSelect
    Key DEL
    DeleteToStartofLine
    "'Allemagne');"
    But it doesn't work...

    May you help me ? :)
    Thanks !

    206
    MasterMaster
    206

      Feb 24, 2006#2

      InsertMode
      ColumnModeOff
      HexOff
      UnixReOn
      Bottom
      IfColNum 1
      Else
      "
      "
      EndIf
      Top
      Find RegExp "^(.*,.*,).*$"
      Replace All "\1'Allemagne');"
      Software For Metalworking
      http://closetolerancesoftware.com

      3
      NewbieNewbie
      3

        Feb 24, 2006#3

        Thanks for replying so quickly !

        I managed to do what i want with :

        Code: Select all

        ColumnModeOff
        HexOff
        Find ","
        Find ","
        DeleteToEndofLine
        ",'ALLEMAGNE');"
        Key RIGHT ARROW
        
        :) :)

          Feb 24, 2006#4

          Now i have

          Code: Select all

          INSERT INTO Codes VALUES (01129,'DRESDEN','ALLEMAGNE');
          INSERT INTO Codes VALUES (01139,'DRESDEN','ALLEMAGNE');
          INSERT INTO Codes VALUES (01157,'DRESDEN','ALLEMAGNE');
          
          I would like to add " ' ' " around the zip code like this :

          Code: Select all

          INSERT INTO Codes VALUES ('01129','DRESDEN','ALLEMAGNE');
          INSERT INTO Codes VALUES ('01139','DRESDEN','ALLEMAGNE');
          INSERT INTO Codes VALUES ('01157','DRESDEN','ALLEMAGNE');
          
          Could you help me, please!

          344
          MasterMaster
          344

            Feb 24, 2006#5

            With Unix Regexp search option on:

            replace: (\d\d\d\d\d)
            with: '\1'

            rds Bego
            Normally using all newest english version incl. each hotfix. Win 10 64 bit