Loading ...
Sorry, an error occurred while loading the content.

[jasspa] Re: Command-line multiple files global-search and replace

Expand Messages
  • Detlef Groth
    ... This was a good tip: I was generating: ; German to LaTex text file convertion routine. Run: ; me @ger2tex ; converts also other symbols to
    Message 1 of 2 , Oct 5, 1999
    • 0 Attachment
      At 12:49 04.10.99 +0100, you wrote:
      >
      >Suggest you look at printall.emf or dos2unix.emf which do this.
      >
      >Steve
      >
      This was a good tip:

      I was generating:

      ; German to LaTex text file convertion routine. Run:
      ; me "@ger2tex" <files>
      ; converts also other symbols to proper tex
      ;
      ; Author : Detlef Groth
      ; Last Modified : <04.10.99 15.00>
      ;
      define-macro start-up
      delete-other-windows
      ; german keyboard configuration
      translate-key "A-C-7 A-C-{" "\x7b"
      translate-key "A-C-9 A-C-]" "\x5d"
      translate-key "A-C-0 A-C-}" "\x7d"
      translate-key "A-C-[ A-C-\\" "\x5c"
      translate-key "A-C-= A-C-~" "\x7e"
      translate-key "A-C-m A-C-\xb5" "\xb5"
      translate-key "A-C-8 A-C-[" "\x5b"
      translate-key "A-C-q A-C-@" "\x40"
      translate-key "A-C-2 A-C-²" "\xb2"
      translate-key "A-C-b A-C-|" "\x7c"
      ; end german keyboard
      !while ¬ &seq $buffer-bname "*scratch*"
      ml-write &spr "Processing [%s]" $buffer-fname
      beginning-of-buffer
      replace-string "ä" "\"a" ; conversion ä -> \"a ff
      beginning-of-buffer
      replace-string "ö" "\"o"
      beginning-of-buffer
      replace-string "ü" "\"u"
      beginning-of-buffer
      replace-string "Ä" "\"A"
      beginning-of-buffer
      replace-string "Ö" "\"O"
      beginning-of-buffer
      replace-string "Ü" "\"U"
      beginning-of-buffer
      replace-string "ß" "\"s"
      beginning-of-buffer
      replace-string "µ" "\$\\\\mu\$"
      beginning-of-buffer
      replace-string "°" "\$\^\\\\circ\$"
      beginning-of-buffer
      replace-string "±" "\$\\\\pm\$"
      save-buffer
      delete-buffer $buffer-bname
      !done
      exit-emacs
      !emacro
      ;;; end of file

      which can process many files at one time.

      >What do you think about using perl - it is much easier to automate
      >translations.
      >s/ä/\"a/g i.e. sed syntax s
      >tr/from/to tr syntax
      >
      >Arne
      >
      Of course it is easier using texttools like awk, perl, tr or gsar, but for many users it is difficult to learn perl or awk. So it would be fine, if Me could do this inside a batch file, requiring only one program to write and to process.

      However the Me32.exe does not work properly inside batches here, because the batch is continuing during the translations. So you have to use the dos-exe me.exe inside a batch here.

      Best regards, Detlef
    Your message has been successfully submitted and would be delivered to recipients shortly.