in reply to Re (tilly) 3: UnEscaping text...
in thread UnEscaping text...

I know, what u mean, but i guess i expressed myself poorly :) TXT File: c:\\sth c:\\\\sth I need the output to be: c:\sth c:\\sth The TXT file allready contains "escaped text" (literal representation).

Replies are listed 'Best First'.
Re (tilly) 5: UnEscaping text...
by tilly (Archbishop) on Aug 14, 2001 at 13:46 UTC
    FYI a literal representation is "exact, unchanged". What you are describing in your text file is not a literal representation. Now the following script may do what you want:
    #! /usr/bin/perl -w while (<>) { s/\\(.)/$1/g; print; }
    If that makes little sense to you then I highly recommend picking up the Llama book, Learning Perl. (One of whose authors is merlyn.)
      Thanx! That was exactly what I was looking for. Thanx to all! Just 1 more question (if u have the time) what's the putpose of '.' in 's/\\(.)/$1/g;'

        The dot matches any character (apart from newline) in a regex. Read up on perlre to get an introduction to regexes. Or read japhy's excellent book - which is to be published next year by Manning.

        -- Hofmator