SyntaxFix
Write A Post
Hire A Developer
Questions
Try doing this :
awk '{print substr($0, 1, length($0)-1)}' file.txt
This is more generic than just removing the final comma but any last character
If you'd want to only remove the last comma with awk :
awk '{gsub(/,$/,""); print}' file.txt