Efficient way to convert 300 RTF files to TXT files to be place in MySQL database
What would be an easy way to do this? Should I try to parse the RTF with PHP? I currently am just reading the TXT files with PHP and placing them in the database based on filename.
It seems like I could write an Applescript to bring the RTF content from Text Edit to BBEdit and save it as TXT but I am not sure how.
It seems like I could write an Applescript to bring the RTF content from Text Edit to BBEdit and save it as TXT but I am not sure how.
Comments
Originally posted by thuh Freak
you can get the program 'unrtf' (available in fink). it converts rich text files to various formats (including text). unfortunately, the writer adds a header to all the output'd files, but you can chop that off (or hack the program to take the header off; it is OSS afterall).
Unrtf doesn't seem to be available through fink. And I get an error when I try to compile the code from the site.
Originally posted by jante99
Unrtf doesn't seem to be available through fink. And I get an error when I try to compile the code from the site.
its on the unstable branch. you'll have to check their site to get directions to access the unstables, cuz i dont remeber the step-by-step. if you already have access, you may just need to update fink with 'sudo fink selfupdate-cvs'. i got errors trying to compile it myself too. if you edit the Makefile, putting 'CC=g++' (replacing what they had), and 'g++ ${OBJS} -o ${TARGET}' replacing what they had after '${TARGET}: ${OBJS}'. Then you should be able to compile with 'make'.
on open names
string test = location of names
string test2 = "/sw/bin/untrf --text " + test
tell application "Terminal" to (do script test2)
quit
end open
The script compiles fine in Project Builder but I get error -2753 (variable test not defined) when I actually run the script.