Merge .txt & .csv
    • Dark
      Light

    Merge .txt & .csv

    • Dark
      Light

    Article summary

    This article explains explains how to merge CSVs, this is a for advanced users as it require to use the terminal. This can be useful when you have many files to import that have the same format, for example reports split by artists or if you would like to merge all


    Merge .txt or .csv with MAC OS

    set-up terminal at folder shortcut

    1. open finder
    2. Click Finder > Services > Services Settings
      servicessettings1.png
    3. In the files and folder section; tick New terminal at Folder
      servicessettings2.png

    Merge TXT files:

    1. Create a new folder in finder

    2. Move all CSVs to merge within the newly create folder
      ⚠️ make sure reports in the folder are from the same royalty source and period

    3. Open the terminal from a folder
      newterminalatfolder.png

    4. In the terminal, paste the following query:

      awk '(NR == 1) || (FNR > 1)' *.txt > mergedstatements_month_year.txt
      
    5. a .txt file will be created in the folder with all the data merged into a single file. To avoid any confusion, rename the file with the relevant month and year.

    Merge CSV files:

    1. Create a new folder in finder
    2. Move all CSVs to merge within the newly create folder
      ⚠️ make sure reports in the folder are from the same royalty source and period
    3. Open the terminal from a folder
      newterminalatfolder.png
    4. In the terminal, paste the following query:
      awk '(NR == 1) || (FNR > 1)' *.csv > mergedstatements_month_year.csv
      

    terminal command.png

    1. a .csv file will be created in the folder with all the data merged into a single file. To avoid any confusion, rename the file with the relevant month and year.

    Was this article helpful?