Click here to Skip to main content
15,890,557 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi All,

I don't have any idea of how to program. I want a vb program, can anyone help me with this.
My requirement is that I have multiple text files in a folder and sub folders too.
In each text file I want to remove the first 5 lines and then rename those text files with the original name but with the extension changed '.xml'.

Thanks in advance.

UPDATED from OP comment below:

XML
http ok
request number
date:14-01-2011
time :
This is response.
<body>
Hello
<age>21</age>
</body>




now i want to retain only the xml part.
first five line will be available in all the text files.
after removing the first 5 lines i want to save as .xml ext. there are 100's of files like this in folder and sub folders too.
Posted
Updated 14-Feb-11 4:59am
v3

First, you have to hire a programmer. At that point, he'll probably be happy to tell you that if you take an XML file, and remove the first five lines of the file, it's no longer a valid XML file. I'll let you future employee explain why during his interview.
 
Share this answer
 
v3
Comments
Amar Venkat Jammula 14-Feb-11 9:08am    
you did not get what i am saying. if you want i will clear my scenario again.
#realJSOP 14-Feb-11 11:23am    
I just noticed that you're using vbscript, and not a .Net language. I can't comment on vbscript, beyond mentioning that you need the appropriate header in the file to make it XML.
Amar Venkat Jammula 14-Feb-11 12:05pm    
any lang is fine.
Sergey Alexandrovich Kryukov 14-Feb-11 17:36pm    
My 5! Despite OP claims you did not understand, whole thing smells like a lack of a programmer :-)
--SA
What is in the text files? Can you post a sample of the first 10 lines? Depending on what you have in the first 5 lines, you may or may not be able to save it as xml format file. Of course you can rename any file to .xml, but that won't make it xml file.
 
Share this answer
 
Comments
Amar Venkat Jammula 14-Feb-11 10:29am    
http ok
request number
date:14-01-2011
time :
This is response.
<body>
<name>Hello
<age>21</age>
</body>

now i want to retain only the xml part.
first five line will be available in all the text files.
after removing the first 5 lines i want to save as .xml ext. there are 100's of files like this in folder and sub folders too.
Sergey Alexandrovich Kryukov 14-Feb-11 17:38pm    
Complete mess, better re-think your model. Yes, you can do it easily, but will not get anything well working and supportable. XML part, non-XML part... Whoever invented that gibberish, remove it and make something regular. XML is XML...
--SA
Amar Venkat Jammula 14-Feb-11 23:57pm    
this how XML looks like:
HTTP/1.0 200 OK
Connection: close
Content-Length: 718
Content-Type: text/xml;charset="UTF-8"
Date: Tue, 08 Feb 2011 09:43:43 GMT



<soap:envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:header><ds_stat xmlns="http://schemas.reuters.com/ns/2006/01/docsearch"><stat _1_uid="0" _2_frt="74" _3_et="28" _4_st="371" _5_rt="0" _6_fdr="0" _tt="478" class="285213185" id="0" it="0" pf="0" usr="94_31917523"><transactionInfo xmlns="http://schemas.reuters.com/ns/2005/08/infrastructure/tornado_soap"><id>?</transactionInfo><applicationInfo xmlns="http://schemas.reuters.com/ns/2005/08/infrastructure/tornado_soap"><app>?</app></applicationInfo><soap:body><resp_docids_1 xmlns="http://schemas.reuters.com/ns/2006/01/docsearch" status="ok">

this is a response file(multiple files like this), now i need to remove all the five lines from the top and rename its ext to .xml

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900