473,395 Members | 1,460 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Read .RTF file using PHP

45
Hi everyone,

I have some .rtf extension file and i want to read that file using php on html page but i am not able to do this.

If it is .txt file then there is no problem but it is RTF and DOC file. Can any one tell me the soluion.

i will be very thank full to all its very urgent.
Jun 23 '09 #1
4 4872
dlite922
1,584 Expert 1GB
what do you see when you try to read the file?

Are you looking to display in the same format and font as the Rich Text or just looking for the textual data?
Jun 23 '09 #2
tokcy
45
when i am trying to open the rtf file it looks something like this

{\rtf1\ansi\ansicpg1252\deff0\deflang1033{\fonttbl {\f0\fswiss\fcharset0 Arial;}{\f1\fswiss\fprq2\fcharset0 Arial;}"

and i want to display the text of file as it is...
Jun 24 '09 #3
dlite922
1,584 Expert 1GB
Well first, I hope that's not the complete file, but thanks for showing me a sample. For you to get the text is to strip out all the RTF formatting (which look like what you posted) Try to look for pattern of where your data is (and isn't) and build a regex to capture your data.

RegexBuddy is a highly recommended program for regex beginners.



Dan
Jun 24 '09 #4
tokcy
45
Hi thanks for your reply but regex is working file with .DOC file and not working with .RTF file.
I am sending all rtf format for file and original format also...

Original format is

Acknowledgment by Endorsement on Deed

Paid a sum of Rs . . . . . . . . towards part-payment of the amount due on this pronote.
Dated. . . . . . . .     A.B.
        (Signature)

and Rtf format is


rtf1 ansi ansicpg1252 uc1 deff2 stshfdbch0 stshfloch0 stshfhich0 stshfbi0 deflang2057 deflangfe2057 fonttbl f0 froman fcharset0 fprq2 panose 02020603050405020304 Times New Roman f2 fmodern fcharset0 fprq1 panose 02070309020205020404 Courier New f11 froman fcharset128 fprq1 panose 02020609040205080304 MS Mincho falt l r 81 66c f37 froman fcharset0 fprq2 panose 00000000000000000000 Times f38 fmodern fcharset128 fprq1 panose 02020609040205080304 @MS Mincho f199 froman fcharset238 fprq2 Times New Roman CE f200 froman fcharset204 fprq2 Times New Roman Cyr f202 froman fcharset161 fprq2 Times New Roman Greek f203 froman fcharset162 fprq2 Times New Roman Tur f204 froman fcharset177 fprq2 Times New Roman (Hebrew) f205 froman fcharset178 fprq2 Times New Roman (Arabic) f206 froman fcharset186 fprq2 Times New Roman Baltic f207 froman fcharset163 fprq2 Times New Roman (Vietnamese) f219 fmodern fcharset238 fprq1 Courier New CE f220 fmodern fcharset204 fprq1 Courier New Cyr f222 fmodern fcharset161 fprq1 Courier New Greek f223 fmodern fcharset162 fprq1 Courier New Tur f224 fmodern fcharset177 fprq1 Courier New (Hebrew) f225 fmodern fcharset178 fprq1 Courier New (Arabic) f226 fmodern fcharset186 fprq1 Courier New Baltic f227 fmodern fcharset163 fprq1 Courier New (Vietnamese) f569 froman fcharset238 fprq2 Times CE f570 froman fcharset204 fprq2 Times Cyr f572 froman fcharset161 fprq2 Times Greek f573 froman fcharset162 fprq2 Times Tur f574 froman fcharset177 fprq2 Times (Hebrew) f575 froman fcharset178 fprq2 Times (Arabic) f576 froman fcharset186 fprq2 Times Baltic f577 froman fcharset163 fprq2 Times (Vietnamese) colortbl red0 green0 blue0 red0 green0 blue255 red0 green255 blue255 red0 green255 blue0 red255 green0 blue255 red255 green0 blue0 red255 green255 blue0 red255 green255 blue255 red0 green0 blue128 red0 green128 blue128 red0 green128 blue0 red128 green0 blue128 red128 green0 blue0 red128 green128 blue0 red128 green128 blue128 red192 green192 blue192 stylesheet ql fi-360 li360 ri1440 sb26 sl-226 slmult0 widctlpar tqr tldot tx15120 aspalpha aspnum faauto adjustright rin1440 lin360 itap0 f2 fs20 lang1033 langfe1033 cgrid langnp1033 langfenp1033 snext0 Normal cs10 additive ssemihidden Default Paragraph Font ts11 tsrowd trftsWidthB3 trpaddl108 trpaddr108 trpaddfl3 trpaddft3 trpaddfb3 trpaddfr3 trcbpat1 trcfpat1 tscellwidthfts0 tsvertalt tsbrdrt tsbrdrl tsbrdrb tsbrdrr tsbrdrdgl tsbrdrdgr tsbrdrh tsbrdrv ql li0 ri0 widctlpar aspalpha aspnum faauto adjustright rin0 lin0 itap0 fs20 lang1024 langfe1024 cgrid langnp1024 langfenp1024 snext11 ssemihidden Normal Table s15 ql fi-360 li360 ri1440 sb26 sl-226 slmult0 widctlpar tqc tx4320 tqr tx8640 aspalpha aspnum faauto adjustright rin1440 lin360 itap0 f2 fs20 lang1033 langfe1033 cgrid langnp1033 langfenp1033 sbasedon0 snext15 header s16 qj fi360 li0 ri0 sb160 sl-250 slmult0 widctlpar aspalpha aspnum faauto adjustright rin0 lin0 itap0 f37 fs21 lang2057 langfe1033 cgrid langnp2057 langfenp1033 sbasedon0 snext16 Body Text s17 qc li0 ri0 sb40 sl-238 slmult0 widctlpar aspalpha aspnum faauto adjustright rin0 lin0 itap0 i f37 fs21 lang1033 langfe1033 cgrid langnp1033 langfenp1033 sbasedon0 snext17 styrsid5969195 Form-head s18 qc li0 ri0 sb480 sa40 sl-240 slmult0 widctlpar aspalpha aspnum faauto adjustright rin0 lin0 itap0 b f37 fs21 lang1033 langfe1033 cgrid langnp1033 langfenp1033 sbasedon0 snext18 styrsid5969195 Form-No s19 qj li0 ri0 sb40 sl-236 slmult0 widctlpar tqc tx4320 tqr tx8640 aspalpha aspnum faauto adjustright rin0 lin0 itap0 f37 fs21 lang2057 langfe1033 cgrid langnp2057 langfenp1033 sbasedon0 snext19 footer cs20 additive f37 fs21 sbasedon10 page number latentstyles lsdstimax156 lsdlockeddef0 rsidtbl rsid5775480 rsid5969195 rsid16732211 generator Micr osoft Word 11.0.6568 info title PRECEDENTS author Mrs. Neelu operator JB creatim yr1998 mo1 dy10 hr12 min17 revtim yr2009 mo6 dy8 hr13 min29 version5 edmins1 nofpages1 nofwords28 nofchars160 company EBC Publishing Pvt. Ltd. nofcharsws187 vern24579 paperw11909 paperh16834 widowctrl ftnbj aenddoc pgnstart13 noxlattoyen expshrtn noultrlspc dntblnsbdb nospaceforul hyphcaps0 formshade horzdoc dgmargin dghspace180 dgvspace180 dghorigin1800 dgvorigin1440 dghshow1 dgvshow1 jexpand viewkind1 viewscale100 pgbrdrhead pgbrdrfoot splytwnine ftnlytwnine htmautsp nolnhtadjtbl useltbaln alntblind lytcalctblwd lyttblrtgr lnbrkrule rsidroot5969195 fet0 sectd binsxn7 psz9 sbknone pgnrestart pgnstarts13 linex0 headery1440 footery1440 endnhere sectdefaultcl sftnbj pnseclvl1 pnucrm pnstart1 pnindent720 pnhang pntxta . pnseclvl2 pnucltr pnstart1 pnindent720 pnhang pntxta . pnseclvl3 pndec pnstart1 pnindent720 pnhang pntxta . pnseclvl4 pnlcltr pnstart1 pnindent720 pnhang pntxta ) pnseclvl5 pndec pnstart1 pnindent720 pnhang pntxtb ( pntxta ) pnseclvl6 pnlcltr pnstart1 pnindent720 pnhang pntxtb ( pntxta ) pnseclvl7 pnlcrm pnstart1 pnindent720 pnhang pntxtb ( pntxta ) pnseclvl8 pnlcltr pnstart1 pnindent720 pnhang pntxtb ( pntxta ) pnseclvl9 pnlcrm pnstart1 pnindent720 pnhang pntxtb ( pntxta ) pard plain s16 qj fi720 li2880 ri0 sb80 sl-270 slmult0 widctlpar aspalpha aspnum faauto adjustright rin0 lin2880 itap0 f37 fs21 lang2057 langfe1033 cgrid langnp2057 langfenp1033 fs24 insrsid5969195 par pard plain s17 qc li0 ri0 sb80 sl-270 slmult0 widctlpar aspalpha aspnum faauto adjustright rin0 lin0 itap0 i f37 fs21 lang1033 langfe1033 cgrid langnp1033 langfenp1033 fs24 insrsid5969195 Acknowledgment by Endorsement on Deed par fs24 insrsid16732211 par pard plain s16 qj fi360 li0 ri0 sb80 sl-270 slmult0 widctlpar aspalpha aspnum faauto adjustright rin0 lin0 itap0 f37 fs21 lang2057 langfe1033 cgrid langnp2057 langfenp1033 fs24 lang1033 langfe1033 langnp1033 insrsid5969195 Paid a sum of Rs . . . . . . . . towards part-payment of the amount due on this pronote. par Dated. . . . . . . . tab tab tab tab fs24 lang1033 langfe1033 loch af11 hich af11 dbch af11 langnp1033 insrsid5969195 loch af11 hich af11 dbch f11 u8195 3f loch af11 hich af11 dbch f11 u8195 3f loch af11 hich af11 dbch f11 u8195 3f fs24 lang1033 langfe1033 langnp1033 insrsid5969195 tab tab A.B. par pard s16 qj fi720 li2880 ri0 sb80 sl-270 slmult0 widctlpar aspalpha aspnum faauto adjustright rin0 lin2880 itap0 fs24 loch af11 hich af11 dbch af11 insrsid5969195 loch af11 hich af11 dbch f11 u8195 3f loch af11 hich af11 dbch f11 u8195 3f loch af11 hich af11 dbch f11 u8195 3f loch af11 hich af11 dbch f11 u8195 3f loch af11 hich af11 dbch f11 u8195 3f loch af11 hich af11 dbch f11 u8195 3f loch af11 hich af11 dbch f11 u8195 3f fs24 insrsid5969195 tab tab (Signature) par


Please if u have some solution then provide me ASAP because its very urgent otherwise i will loose my job...

Thanks in advance...
Jun 25 '09 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Anne-Marte | last post by:
Hi I simply don't understand how to read a simple file using std::istream. How do I open a file for reading with istream?? Anne-Marte
14
by: Mark Broadbent | last post by:
Does anybody know what is (factual please -not just guess) the quickest method to read data from a file? I am not interested in the format of the data (i.e. blocks, bytes, string etc) just that the...
4
by: ESPN Lover | last post by:
Below is two snippets of code from MSDN showing how to read a file. Is one way preferred over the other and why? Thanks. using System; using System.IO; class Test { public static void...
5
by: JenHu | last post by:
Hi experts, I wrote a function which retrieves a file in the folder, the file path is : Dim sr As New StreamReader(strFilepath & ReturnFileName) What if I have more than 1 file_name in...
8
by: james | last post by:
I am trying to use Filestream to read a file ( .DAT) that contains values in HEX that I want to convert to text. I know the different offset addresses for each portion of the data I am trying to...
8
by: a | last post by:
I have a struct to write to a file struct _structA{ long x; int y; float z; } struct _structA A; //file open write(fd,A,sizeof(_structA)); //file close
5
by: Sumana | last post by:
Hi All, We developed our project on VC++.Net console application to create image of disk and to write the image We are having problem with reading and writing the sector beyond 6GB Disk or...
3
by: Yaniv | last post by:
Hi I'm new in VB.NET. I wrote an application which opens a text file and read it all lines untill the EOF this file is open for read only and for sharing asllowed. every 5 seconds another...
3
by: Ray | last post by:
Hello World, I made a Windowsform that reads data from a CSV file. It works fine, but when I have read the data of a record I have to re-Debug the form to read another record. So when I put a...
6
by: Thomas Kowalski | last post by:
Hi, currently I am reading a huge (about 10-100 MB) text-file line by line using fstreams and getline. I wonder whether there is a faster way to read a file line by line (with std::string line)....
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.