Merging Two Text Files into One CSV File

前端 未结 3 1605
轻奢々
轻奢々 2021-01-23 01:56

I\'m working with a windows batch command to create a list of filepaths and filenames (without the ext) for processing and archival. I need to make a CSV file that will contain

相关标签:
3条回答
  • 2021-01-23 02:32

    This Windows batch file will do what you want without the need for the intermediate files.

    @ECHO OFF
    
    FOR %%i IN (*.txt) DO ECHO %%~fi,%%~ni
    

    You can get the output of this batch into a text file by redirecting the output like this:

    MyBatch.cmd>>Output.txt
    
    0 讨论(0)
  • 2021-01-23 02:51

    This could be a job for the SQLite shell.

    C:\Temp> sqlite3.exe
    create table paths(path text);
    create table filenames(fname text);
    .import fileListA.txt paths
    .import fileListB.txt filenames
    .separator ,
    .output FileListCSV.txt
    select * from paths p join filenames f on f.rowid = p.rowid;
    .q
    

    The SQLite shell is a single executable that will either create a persistent SQLite database in the form of a file, or create a database in memory (when, like here, without any argument in the command line).

    0 讨论(0)
  • 2021-01-23 02:55

    This can be done pretty fast in EasyMorph using Append transformation in "Append columns" mode.

    0 讨论(0)
提交回复
热议问题