批量复制的多个文本文件的第一行 [英] batch to copy FIRST line of multiple text files

查看:198
本文介绍了批量复制的多个文本文件的第一行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要一批code到多个文本文件的第一行原来的文件名复制到一个新的文本文件附加到每一行,如果可能的话编辑批处理code到任何行号的方法一个人想。

I need the batch code to copy the FIRST line of multiple text files into a new text file and append original filenames to each line, and if possible a way of editing the batch code to any LINE number one wants.

感谢

推荐答案

本使用名为 findrepl.bat 从助手批处理文件 - https://www.dropbox.com/s/rfdldmcb6vwi9xc/findrepl.bat

This uses a helper batch file called findrepl.bat from - https://www.dropbox.com/s/rfdldmcb6vwi9xc/findrepl.bat

findrepl.bat 在同一文件夹中的批处理文件或路径上。

Place findrepl.bat in the same folder as the batch file or on the path.

@echo off
set linenum=1
for %%a in (*.txt) do (
   type "%%a"|findrepl /o:%linenum%:%linenum% >>tmp.tmp
)
move /y tmp.tmp "Result.txt"

这篇关于批量复制的多个文本文件的第一行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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