UNIX extracting fields

I have one file A.txt which is comma separated and I want to extract first 4 field's in a file and also I want to add one more column in output
A.txt in output for all records. A.txt should not be hard coded since I do not filename it may be any file.

Any attempt/idea/thought from your side?

How about way more details in your request? I'm pretty sure you wouldn't like an answer like "Use awk, write $1 till $4 and add you new column, using a variable for the input stream", would you?

1 Like