in reply to Re^2: How to tokenize a RTF file and print it to another file
in thread How to tokenize a RTF file and print it to another file

Hello again mdavies23,

I recommend the closing of file handles because the output of you text might be still on the buffer. Read here why it is important to use close.

Maybe your code works straight out of the box with the close fh function I do not know yet. I will create an RTF document and I will start playing with it.

We are here to assist and guide. I hope you are not taking my suggestions in an insulting way. We all where beginners and we are still are in different areas. Just keep reading as much possible documentation provided here or on the network and you will learn really really fast.

Update: Sample of RTF file provided bellow. In case that someone wants to play with. The source of the code is The_RTF_Cookbook/SAMPLE COMPLETE RTF DOCUMENT.

{\rtf1\ansi\deff0 {\fonttbl {\f0 Times New Roman;} } \deflang1033\widowctrl {\header\pard\qr\plain\f0{\noproof\i La dame} p.\chpgn\par} \lang1036\fs36 {\pard\qc\f1\fs60\b\i La dame\par} {\pard\sb300\li900 Toc toc Il a ferm\'e9 la porte\line Les lys du jardin sont fl\'e9tris\line Quel est donc ce mort qu'on emporte \par} {\pard\sb300\li900 Tu viens de toquer \'e0 sa porte\line Et trotte trotte\line Trotte la petite souris \par} {\pard\sb900\li900\scaps\fs44 \endash Guillaume Apollinaire, {\i Alcools}\par} \page\lang1033\fs32 {\pard\b\ul\fs40 Vocabulary\par} {\pard\li300\fi-150{\noproof\b toc }{\i(n.m.)} \endash tap; knock\p +ar} {\pard\li300\fi-150{\noproof\b lys }{\i(n.m.)} \endash lily\par} {\pard\li300\fi-150{\noproof\b fl\'e9trir } {\i(v.itr.)} \endash to wilt; for a flower or beauty to fade; for a plant to wither\par} {\pard\li300\fi-150{\noproof\b mort } {\i(adj., here used as a masc. noun)} \endash dead\par} {\pard\li300\fi-150{\noproof\b emporter } {\i(v.tr.)} \endash to take a person or thing [somewhere]; to take\~[out/away/etc.] or carry\~[away] a thing\par} {\pard\li300\fi-150{\noproof\b toquer } {\i(v.itr.)} \endash to tap; to knock\par} {\pard\li300\fi-150{\noproof\b trotter } {\i(v.itr.)} \endash to trot; to scurry\par} {\pard\li300\fi-150{\noproof\b souris }{\i(n.f.)} \endash mouse\par +} {\pard\sb200\b\ul\fs40 Free Translation\par} {\pard Click click He closed the door / Garden lilies faded / Which body is + today // You just tapped on the door / And tip toe / Taps the little mous +e \line \_Translation Sean M. Burke, 2001 \par} }

Hope this helps, BR.

Seeking for Perl wisdom...on the process of learning...not there...yet!