wsfile 这个txt批量处理器可以实现,合并TXT就可以将很多txt放在一个txt里面 或者下面这个宏可以将文件名作为第一列,其他数据依次导入;你可以试试
Sub aa()
Dim s As String
s = Dir(ThisWorkbook.Path & "/*.txt")
Do While s <> ""
Open ThisWorkbook.Path & "/" & s For Input As #1
Do While Not EOF(1)
i = i + 1
Input #1, x
Cells(i, 2) = x
Cells(i, 1) = s
Loop
Close #1
s = Dir()
Loop
End Sub
@echo off&setlocal Enabledelayedexpansion
rem 设置为txt文件的路径
set folderpath=C:\temp\
for /f "tokens=*" %%i in ('dir /b %folderpath%*.txt') do call :rn %%~ni
goto eof
:rn %1
set txt=,%1
type nul>%1_new.txt
for /f "tokens=*" %%j in (%1.txt) do echo %%j!txt!>>%1_new.txt
del /q %folderpath%%1.txt
ren %folderpath%%1_new.txt %1.txt
:eof