Importing first line of TXT files to a spreadsheet
Under Windows, you can do this with a batch file:
@echo off
setlocal enabledelayedexpansion
set OUTPUT=names.csv
del %OUTPUT% > nul 2>&1
for %%f in (*.txt) do (
set /p NAME=< %%f
echo %%f,!NAME! >> %OUTPUT%
)
endlocal
If you want the filename without the extension, change the for loop to this:
for %%f in (*.txt) do (
set /p NAME=< %%f
set INPUT=%%f
echo !INPUT:~0,-4!, !NAME! >> %OUTPUT%
)