I want to add filename (without extension) at the end for all the lines for all the csv files in a folder. All the files are having the same header. Let's say I have two files a.csv and b.csv in a folder.a.csv contains (first line is a header)  num1,num2,num3  1,2,3b.csv contains (first line is a header)    num1,num2,num3    4,5,6I want a.csv file to be (first line is a header)  num1,num2,num3,filename  1,2,3,aI want b.csv file to be (first line is a header)  num1,num2,num3,filename  4,5,6,bHow can I do it in Unix?
Add a header field, and the file's name at the end of the data lines, for all the csv files in a folder
text processing;command line;filenames;csv simple