You're working much too hard :)

#! perl -w use strict; while( <DATA> ) { s!([%&_~{}^#\\])!\\$1!g; print; } __DATA__ "% & _ ~ { } ^ # \ " "Sonntag, 26.05.2013 - 13:13:27","0","Lieber Herr % , & text text with + some %special characters" "Sonntag, 26.05.2013 - 13:35:47","1","Sehr gerne! ^ _~}# and here some + other characters" "Sonntag, 26.05.2013 - 13:49:15","0",":-))" "Mittwoch, 05.06.2013 - 18:12:09","0","Besten Dank, & hat prima geklap +pt. {Greetings!}" "Mittwoch, 05.06.2013 - 19:16:47","1","% _ text text!" "Mittwoch, 05.06.2013 - 19:17:30","0","~Prima! #Danke!!" "Samstag, 08.06.2013 - 09:21:09","1","_ 10. Jul Text text %" "Samstag, 08.06.2013 - 10:08:45","0","Ja, osaka ffm lh 741 & ffm muc l +h 114 abflug 16:00"
C:\test>junk "\% \& \_ \~ \{ \} \^ \# \\ " "Sonntag, 26.05.2013 - 13:13:27","0","Lieber Herr \% , \& text text wi +th some \%special characters" "Sonntag, 26.05.2013 - 13:35:47","1","Sehr gerne! \^ \_\~\}\# and here + some other characters" "Sonntag, 26.05.2013 - 13:49:15","0",":-))" "Mittwoch, 05.06.2013 - 18:12:09","0","Besten Dank, \& hat prima gekla +ppt. \{Greetings!\}" "Mittwoch, 05.06.2013 - 19:16:47","1","\% \_ text text!" "Mittwoch, 05.06.2013 - 19:17:30","0","\~Prima! \#Danke!!" "Samstag, 08.06.2013 - 09:21:09","1","\_ 10. Jul Text text \%" "Samstag, 08.06.2013 - 10:08:45","0","Ja, osaka ffm lh 741 \& ffm muc +lh 114 abflug 16:00"

With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.

In reply to Re: Escape special characters for a LaTeX file by BrowserUk
in thread Escape special characters for a LaTeX file by marek1703

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.