in reply to Re^2: Converting a passage of Spanish into hyphens and spaces
in thread Converting a passage of Spanish into hyphens and spaces

I'm not sure if that will tell me everything I need to know, but the error messages will certainly help diagnose it better.

  • Comment on Re^3: Converting a passage of Spanish into hyphens and spaces

Replies are listed 'Best First'.
Re^4: Converting a passage of Spanish into hyphens and spaces
by UKhombre (Initiate) on Sep 13, 2015 at 13:50 UTC

    I've just tried the Unicode one again and this time I got it to work. I don't know what I did differently in terms of my typing in your code plus the file name.

    Recuerdo igual que si fuera hoy el día que llegué. Había hecho el viaje en tren con otros cinco compañeros novatos, y al bajar en la estación fuimos al hotel Condal, donde habíamos reservado habitaciones.

    -------- ----- --- -- ----- --- -- -í- --- -----é. ---í- ----- -- ----- -- ---- --- ----- ----- -----ñ---- -------, - -- ----- -- -- ------ó- ------ -- ----- ------, ----- ---í---- --------- ------------.

    As you can see there's still the letters with accents but if that can't be changed no worries and thank you very much for what you've done.

      As you can see there's still the letters with accents

      Extend your character class to have these translated, too:

      [[:alpha:]áéíóúñü]
      perl -le'print map{pack c,($-++?1:13)+ord}split//,ESEL'
        Thanks. Perl is great and I didn't know anything about it before yesterday.

      If the encoding is utf-8 rather than iso8859-1 then you can use the XPosixAlpha class like this:

      $ echo habíamos reservado habitaciones. | perl -CIO -pe 's/\p{XPosixAl +pha}/-/g;' -------- --------- ------------.
        Cheers I will look into that.