Help for this page

Select Code to Download


  1. or download this
    s/{.*\n//g;                  # remove lines starting with braces
    s/(\\[\w-]+)\b//g;           # remove RTF commands
    s/(\n)\s+(\S+)/$1$2/g;       # remove extra spaces
    s/([^\\\n]+)\\(\n)/$1$2/g;   # get rid of \ at the ends of lines
    s/\\\n//g;                   # get rid of lines with a \ only
    
  2. or download this
    perl -0777 -p remove_rtf_formatting.pl < infile.rtf > outfile.txt