Operating System - Linux
1755406 Members
2932 Online
108832 Solutions
New Discussion юеВ

Re: Convert to RTF format

 

Convert to RTF format

Hello,

I need to convert ascii 'tab delimited' files into RTF format. Does anyone know how to do it ? Is there a converting command or script that could help me ?

Thanks a lot.
mfp
11 REPLIES 11
James R. Ferguson
Acclaimed Contributor

Re: Convert to RTF format

Hi:

Perl's CPAN repository hosts some modules for dealing with RTF. One such is:

http://search.cpan.org/~sburke/RTF-Writer-1.11/lib/RTF/Writer.pod

Regards!

...JRF...

Re: Convert to RTF format

Thank you for your help, but I went to that CPAN site and unfortunately it seems a lot complicated for my needs. Actually, I have about 50 (or more) Unix scripts that create ascii tab delimited files to be used after in mergings with Word 2003. Since Word 2003 doesn't recognize our file format, we were told by Microsoft support to convert our files into RTF format in order to have them recognized by Word 2003. I was expecting to find a 'one line command' that I could insert in my scripts to translate my files '.txt' into an '.rtf' file (something like a trux2rtf ??). But it doesn't seem to exist. Does it ?

mfp
mfp
Court Campbell
Honored Contributor

Re: Convert to RTF format

can you post some sample output, or attach a sample file. it seems odd that Word would have trouble opening the file. I almost wonder if you just need to run unix2dos on the file first.
"The difference between me and you? I will read the man page." and "Respect the hat." and "You could just do a search on ITRC, you don't need to start a thread on a topic that's been answered 100 times already." Oh, and "What. no points???"
Steven Schweda
Honored Contributor

Re: Convert to RTF format

I like the unix2dos theory, too.

> can you post some sample output, or attach
> a sample file.

Or, perhaps, use MS Word to create a suitable
file, save it in RTF, and look at that to see
how the professionals do it. Or, save it as
plain text, and look at that. The real
question is what the required file format is.
RTF may be only a guess by someone who has no
idea. MS Word should be able to read plain
text just fine, if it can see where the lines
end.

> Word 2003 doesn't recognize our file format

What does that mean, exactly? What is in the
file, and what, exactly, does MS Word do/say
(when you do what, exactly)?
Sandman!
Honored Contributor

Re: Convert to RTF format

Since it's tab delimited; run it first thru expand(1) and then thru ux2dos(1) before opening the file in Word. expand(1) will convert the stops into blanks, if that's what you want else simply running it thru ux2dos(1) should be enough.

~hope it helps

Re: Convert to RTF format

Hi everyone,

I am sorry for the delay. I answered yesterday a long explaining message with a example file attached but it seems that it didn't go throw. Here I am again this morning with my explanations.

The problem we have is that our files contain french characters (with accents) and those characters are interpreted as japanese characters by Word 2003 ! So we get errors when executing our macro files. Word is expecting an answer to specify the language used in the file. If I don't find a way to convert my files to RTF, we'll have to modify every macro files all over the place. Those macro files were used for a long time without any errors until we upgraded to Word 2003.

Here is an example of a file.
mfp
Court Campbell
Honored Contributor

Re: Convert to RTF format

I was able to open your file with wordpad and then save it as rtf. then I opened it with word 2003. You may try that.
"The difference between me and you? I will read the man page." and "Respect the hat." and "You could just do a search on ITRC, you don't need to start a thread on a topic that's been answered 100 times already." Oh, and "What. no points???"

Re: Convert to RTF format

Yes, that's what we are working on. We are going to modify the macro files to add a few steps before doing the merge (such as opening the file and saving it in RTF). We would have prefered to avoid modifying them but since there is no way out, we are going to do it.

Thanks a lot everyone.

Have a nice day !
mfp
Court Campbell
Honored Contributor

Re: Convert to RTF format

I am not sure what your macros are doing, but I have the feeling you could write a perl script to produce the same output.
"The difference between me and you? I will read the man page." and "Respect the hat." and "You could just do a search on ITRC, you don't need to start a thread on a topic that's been answered 100 times already." Oh, and "What. no points???"