I have multiple comma-separated files that I need first to merge the rows into a single row then I can append that row to append to one output.csv file.
file-1.txt:
CV-1999-0001,
CV-1999-0002,
CV-1999-0003,
CV-1999-0004,
CV-1999-0005,
  ...
file-2.txt:
CV-2000-0006,
CV-2000-0007,
CV-2000-0008,
....
output.csv:
IDs
CV-1999-0001,CV-1999-0002,CV-1999-0003,CV-1999-0004,CV-1999-0005
CV-2000-0006,CV-2000-0007,CV-2000-0008,CV-2000-0009,CV-2000-0010
I have tried these but none seem to achieve what I need. I still end up with multiple rows
echo $(cat /Users/...../"$ROWS".txt) | sed 's/ //g' > "$ROWS_new".txt
echo $(cat paste -s -d "" files-1.txt) | sed 's/ //g' >> output.csv
    
CV-2000-0009,CV-2000-0010come from? Please edit your question to make sure that the expected output you provide is exactly the output you expect given the same input you provide so it accurately demonstrates your requirements and we have something we can copy/paste to test a potential solution with. And get rid of those...lines that are cluttering up your example. Also, if you don't REALLY wantIDsprinted at the top of your output file then don't show it at the top of your output file.CV-2000-0009andCV-2000-0010in your posted expected output come from since they aren't in your posted sample input? Are they from some 3rd input file or do you need this tool to generate them or is it a mistake in your sample input/output? If the former please edit your question to explain it, if the latter please edit your question to fix that.