Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > How do I remove a line from incoming XML FILE

Reply
Thread Tools

How do I remove a line from incoming XML FILE

 
 
Girish
Guest
Posts: n/a
 
      02-17-2004
I have this XML FILE where I am reading data from and it has this node
doctype "< ! D O C T Y P E a d f S Y S T E M " h t t p : / / w h o s c
a l l i n g . c o m / d t d / a d f d t d . d t d " > "

ONLY When I remove this line I could display the data onto the browser, any
ideas WHY? if not I am using following code to remove the above line, it
doesn't work

Dim FindWhat, ReplaceWith

'dim MyString
'MyString= "Hello" & chr(34) & "World" & chr(34) & "World"

FindWhat = "< ! D O C T Y P E &nbsp;&nbsp;a d f &nbsp; S Y S T E M &nbsp;
" & chr(34) & " h t t p : / / w h o s c a l l i n g . c o m / d t d / a d f
d t d . d t d " & chr(34) & "&nbsp;>"
'FindWhat = FindWhat & " h t t p : / / w h o s c a l l i n g . c o m / d t
d / a d f d t d . d t d "
'FindWhat = FindWhat & ">"

response.write "FindWhat :" & FindWhat & "<br>"

ReplaceWith = ""

Dim fso, sText, fs, DestinationFile, writingFile, sPath
set fso = createobject("scripting.filesystemobject")
sPath = "D:\inetpub\PennyFlyer\carmartnew\business_ivr.xml "

if fso.FileExists(sPath) then

Set fs = fso.OpenTextFile(sPath)
sText = fs.ReadAll()

'response.write "sText" & sText

sText = Replace(sText, FindWhat, ReplaceWith)

DestinationFile = "D:\inetpub\PennyFlyer\carmartnew\newbusiness_ivr. xml"

Set writingFile = fso.CreateTextFile(DestinationFile,true,false)

WritingFile.Write(sText)

WritingFile.Close
end if

Thanks


 
Reply With Quote
 
 
 
 
Mark Schupp
Guest
Posts: n/a
 
      02-17-2004
What error message do you get in the browser?

--
Mark Schupp
Head of Development
Integrity eLearning
www.ielearning.com


"Girish" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> I have this XML FILE where I am reading data from and it has this node
> doctype "< ! D O C T Y P E a d f S Y S T E M " h t t p : / / w h o s

c
> a l l i n g . c o m / d t d / a d f d t d . d t d " > "
>
> ONLY When I remove this line I could display the data onto the browser,

any
> ideas WHY? if not I am using following code to remove the above line, it
> doesn't work
>
> Dim FindWhat, ReplaceWith
>
> 'dim MyString
> 'MyString= "Hello" & chr(34) & "World" & chr(34) & "World"
>
> FindWhat = "< ! D O C T Y P E &nbsp;&nbsp;a d f &nbsp; S Y S T E M

&nbsp;
> " & chr(34) & " h t t p : / / w h o s c a l l i n g . c o m / d t d / a d

f
> d t d . d t d " & chr(34) & "&nbsp;>"
> 'FindWhat = FindWhat & " h t t p : / / w h o s c a l l i n g . c o m / d

t
> d / a d f d t d . d t d "
> 'FindWhat = FindWhat & ">"
>
> response.write "FindWhat :" & FindWhat & "<br>"
>
> ReplaceWith = ""
>
> Dim fso, sText, fs, DestinationFile, writingFile, sPath
> set fso = createobject("scripting.filesystemobject")
> sPath = "D:\inetpub\PennyFlyer\carmartnew\business_ivr.xml "
>
> if fso.FileExists(sPath) then
>
> Set fs = fso.OpenTextFile(sPath)
> sText = fs.ReadAll()
>
> 'response.write "sText" & sText
>
> sText = Replace(sText, FindWhat, ReplaceWith)
>
> DestinationFile = "D:\inetpub\PennyFlyer\carmartnew\newbusiness_ivr. xml"
>
> Set writingFile = fso.CreateTextFile(DestinationFile,true,false)
>
> WritingFile.Write(sText)
>
> WritingFile.Close
> end if
>
> Thanks
>
>



 
Reply With Quote
 
 
 
 
Mark Schupp
Guest
Posts: n/a
 
      02-18-2004
Your attachment opens and displays just fine in IE on my system.

If you are just having problems reading it in and re-writing it why don't
you open it and re-save it with the MSXML component instead of the file
system object?

--
Mark Schupp
Head of Development
Integrity eLearning
www.ielearning.com


"Girish" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> well, it creates a file called newbusiness_ivr.xml and the file should
> contain everything and the node doctype replaced by "" right? It doesn't

it
> just has the following partial data:
>

================================================== ==========================
> ==========
> <
>
>
> < e m a i l > t j a v a @ w h o s c a l l i n g . c o m < / e m a

i
> l >
>
> < p h o n e > 8 6 6 3 1 2 2 2 2 2 < / p h o n e >
>
> < / c o n t a c t >
>
> < / p r o v i d e r >
>
> < / p r o s p e c t >
>
> < / a d f >
>

================================================== ==========================
> ==========
> I am also attaching business_ivr.xml file which is parsed and contains the
> above node.
>
> Thanks
>
> "Mark Schupp" <(E-Mail Removed)> wrote in message
> news:%(E-Mail Removed)...
> > What error message do you get in the browser?
> >
> > --
> > Mark Schupp
> > Head of Development
> > Integrity eLearning
> > www.ielearning.com
> >
> >
> > "Girish" <(E-Mail Removed)> wrote in message
> > news:(E-Mail Removed)...
> > > I have this XML FILE where I am reading data from and it has this node
> > > doctype "< ! D O C T Y P E a d f S Y S T E M " h t t p : / / w h

o
> s
> > c
> > > a l l i n g . c o m / d t d / a d f d t d . d t d " > "
> > >
> > > ONLY When I remove this line I could display the data onto the

browser,
> > any
> > > ideas WHY? if not I am using following code to remove the above line,

it
> > > doesn't work
> > >
> > > Dim FindWhat, ReplaceWith
> > >
> > > 'dim MyString
> > > 'MyString= "Hello" & chr(34) & "World" & chr(34) & "World"
> > >
> > > FindWhat = "< ! D O C T Y P E &nbsp;&nbsp;a d f &nbsp; S Y S T E M

> > &nbsp;
> > > " & chr(34) & " h t t p : / / w h o s c a l l i n g . c o m / d t d /

a
> d
> > f
> > > d t d . d t d " & chr(34) & "&nbsp;>"
> > > 'FindWhat = FindWhat & " h t t p : / / w h o s c a l l i n g . c o m

/
> d
> > t
> > > d / a d f d t d . d t d "
> > > 'FindWhat = FindWhat & ">"
> > >
> > > response.write "FindWhat :" & FindWhat & "<br>"
> > >
> > > ReplaceWith = ""
> > >
> > > Dim fso, sText, fs, DestinationFile, writingFile, sPath
> > > set fso = createobject("scripting.filesystemobject")
> > > sPath = "D:\inetpub\PennyFlyer\carmartnew\business_ivr.xml "
> > >
> > > if fso.FileExists(sPath) then
> > >
> > > Set fs = fso.OpenTextFile(sPath)
> > > sText = fs.ReadAll()
> > >
> > > 'response.write "sText" & sText
> > >
> > > sText = Replace(sText, FindWhat, ReplaceWith)
> > >
> > > DestinationFile =

> "D:\inetpub\PennyFlyer\carmartnew\newbusiness_ivr. xml"
> > >
> > > Set writingFile = fso.CreateTextFile(DestinationFile,true,false)
> > >
> > > WritingFile.Write(sText)
> > >
> > > WritingFile.Close
> > > end if
> > >
> > > Thanks
> > >
> > >

> >
> >

>
>
>



 
Reply With Quote
 
Girish
Guest
Posts: n/a
 
      02-18-2004
u mean that node is not giving problem, r u reading its data via ASP and
displaying it? if yes, please send me some sample and / or URL on MSXML
component please...

Thanks much!
"Mark Schupp" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Your attachment opens and displays just fine in IE on my system.
>
> If you are just having problems reading it in and re-writing it why don't
> you open it and re-save it with the MSXML component instead of the file
> system object?
>
> --
> Mark Schupp
> Head of Development
> Integrity eLearning
> www.ielearning.com
>
>
> "Girish" <(E-Mail Removed)> wrote in message
> news:%(E-Mail Removed)...
> > well, it creates a file called newbusiness_ivr.xml and the file should
> > contain everything and the node doctype replaced by "" right? It

doesn't
> it
> > just has the following partial data:
> >

>

================================================== ==========================
> > ==========
> > <
> >
> >
> > < e m a i l > t j a v a @ w h o s c a l l i n g . c o m < / e m

a
> i
> > l >
> >
> > < p h o n e > 8 6 6 3 1 2 2 2 2 2 < / p h o n e >
> >
> > < / c o n t a c t >
> >
> > < / p r o v i d e r >
> >
> > < / p r o s p e c t >
> >
> > < / a d f >
> >

>

================================================== ==========================
> > ==========
> > I am also attaching business_ivr.xml file which is parsed and contains

the
> > above node.
> >
> > Thanks
> >
> > "Mark Schupp" <(E-Mail Removed)> wrote in message
> > news:%(E-Mail Removed)...
> > > What error message do you get in the browser?
> > >
> > > --
> > > Mark Schupp
> > > Head of Development
> > > Integrity eLearning
> > > www.ielearning.com
> > >
> > >
> > > "Girish" <(E-Mail Removed)> wrote in message
> > > news:(E-Mail Removed)...
> > > > I have this XML FILE where I am reading data from and it has this

node
> > > > doctype "< ! D O C T Y P E a d f S Y S T E M " h t t p : / / w

h
> o
> > s
> > > c
> > > > a l l i n g . c o m / d t d / a d f d t d . d t d " > "
> > > >
> > > > ONLY When I remove this line I could display the data onto the

> browser,
> > > any
> > > > ideas WHY? if not I am using following code to remove the above

line,
> it
> > > > doesn't work
> > > >
> > > > Dim FindWhat, ReplaceWith
> > > >
> > > > 'dim MyString
> > > > 'MyString= "Hello" & chr(34) & "World" & chr(34) & "World"
> > > >
> > > > FindWhat = "< ! D O C T Y P E &nbsp;&nbsp;a d f &nbsp; S Y S T E M
> > > &nbsp;
> > > > " & chr(34) & " h t t p : / / w h o s c a l l i n g . c o m / d t d

/
> a
> > d
> > > f
> > > > d t d . d t d " & chr(34) & "&nbsp;>"
> > > > 'FindWhat = FindWhat & " h t t p : / / w h o s c a l l i n g . c o

m
> /
> > d
> > > t
> > > > d / a d f d t d . d t d "
> > > > 'FindWhat = FindWhat & ">"
> > > >
> > > > response.write "FindWhat :" & FindWhat & "<br>"
> > > >
> > > > ReplaceWith = ""
> > > >
> > > > Dim fso, sText, fs, DestinationFile, writingFile, sPath
> > > > set fso = createobject("scripting.filesystemobject")
> > > > sPath = "D:\inetpub\PennyFlyer\carmartnew\business_ivr.xml "
> > > >
> > > > if fso.FileExists(sPath) then
> > > >
> > > > Set fs = fso.OpenTextFile(sPath)
> > > > sText = fs.ReadAll()
> > > >
> > > > 'response.write "sText" & sText
> > > >
> > > > sText = Replace(sText, FindWhat, ReplaceWith)
> > > >
> > > > DestinationFile =

> > "D:\inetpub\PennyFlyer\carmartnew\newbusiness_ivr. xml"
> > > >
> > > > Set writingFile = fso.CreateTextFile(DestinationFile,true,false)
> > > >
> > > > WritingFile.Write(sText)
> > > >
> > > > WritingFile.Close
> > > > end if
> > > >
> > > > Thanks
> > > >
> > > >
> > >
> > >

> >
> >
> >

>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
Read a file line by line and write each line to a file based on the5th byte scad C++ 23 05-17-2009 06:11 PM
The connection to the server has failed. Account: 'incoming.yahoo.verzon.net', Server: 'incoming.yahoo.verizon.net', Protocol: POP3, Port: 110, Secure(SSL): No, Socket Error: 10061, Error Number: 0x800CCC0E Michael Bower Computer Support 3 10-01-2006 03:44 PM
How to read a text file line by line and remove some line kaushikshome C++ 4 09-10-2006 10:12 PM
Read a file line by line with a maximum number of characters per line Hugo Java 10 10-18-2004 11:42 AM



Advertisments