从所有txt文件中删除前五行,并使用扩展名为.xml的相同文件重命名它们 [英] Removing first five lines from all the txt files and rename them with same file with different extension .xml

查看:117
本文介绍了从所有txt文件中删除前五行,并使用扩展名为.xml的相同文件重命名它们的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我对如何编程一无所知.我想要一个vb程序,有人可以帮我吗.
我的要求是我在一个文件夹和子文件夹中也要有多个文本文件.
在每个文本文件中,我要删除前5行,然后使用原始名称重命名那些文本文件,但扩展名更改为``.xml''.

提前谢谢.

从以下OP评论更新:

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:

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





现在我只想保留xml部分.
前五个行将在所有文本文件中可用.
删除前5行后,我想另存为.xml扩展名.文件夹和子文件夹中也有100个这样的文件.





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.

推荐答案

首先,您必须雇用一名程序员.到那时,他可能会很高兴地告诉您,如果您拿一个XML文件,并删除该文件的前五行,则它不再是有效的XML文件.我让您未来的员工在面试时解释原因.
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.


文本文件中包含什么?您可以发布前10行的样本吗?根据前5行的内容,您可能会也可能无法将其另存为xml格式文件.当然,您可以将任何文件重命名为.xml,但这不会使它成为xml文件.
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.


这篇关于从所有txt文件中删除前五行,并使用扩展名为.xml的相同文件重命名它们的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆