Inserting extra delimiter in CSV file with regex replace

Inserting extra delimiter in CSV file with regex replace

1
NewbieNewbie
1

    Sep 23, 2006#1

    Hi,
    I have a csv file with this setup:
    "name", "address number zipcode city"

    file contains 1200 rows, 2 rows from my file:
    "I-Nails 4 You","Plantsoenstr 9 1441CW Purmerend Kaart / Route "
    "Sylvie Nails and Manicure","G v Prinstererwg 128 2982VE Ridderkerk "

    I need to put an extra delimiter before zipcode
    Using search with regexp: [0-9][0-9][0-9][0-9][a-z] to search zipcode retreives 1200 results, so the expression works...

    I have been trying to replace, keeping the zipcode intact and place a delimter befor it... but can't figure out how...going mad ;-)

    This should be the replace result:
    "I-Nails 4 You","Plantsoenstr 9","1441CW Purmerend "
    "Sylvie Nails and Manicure","G v Prinstererwg 128","2982VE Ridderkerk "

    Any help will be highly appreciated!!!|
    Thanks for taking time to read this...
    have a nice day
    Quokka

    6,675585
    Grand MasterGrand Master
    6,675585

      Sep 23, 2006#2

      With UltraEdit regular expression engine:

      Find: +^([0-9][0-9][0-9][0-9][a-z]^)
      Replace:","^1

      Please note the single space before the + at start of the find string.

      With Unix/Perl regular expression engine:

      Find: +([0-9][0-9][0-9][0-9][a-z])
      Replace:","\1

      or with Unix/Perl also possible:

      Find: +(\d\d\d\d[a-z])
      Replace:","\1

      For an explanation read in help of UltraEdit the page with title Regular Expressions.
      Best regards from an UC/UE/UES for Windows user from Austria