Home > Software design >  How to concat line seperated text files, into a csv file
How to concat line seperated text files, into a csv file

Time:02-16

I'm hoping I worded my question well enough.

I have a directory full of *.log files that look like this

00001
04444
dest = this
flag = this

I want to put them all into 1 file, comma-separated, each file has its own line like this:

00001,04444,dest = this,flag = this
00002,05555,dest = no,flag = 

I know i can create a csv for 1 single file like this

awk '{print}' ORS=','

But how can i quickly do the above for all files in my directory, and then put them all into 1 big csv?

CodePudding user response:

paste -d , -s /path/to/*.log > file.csv 
  • Related