I am trying to add filenames to many *txt files, which are tab-seperated (they will eventually be joined together using cat) I am using bash, on Ubuntu 14.04.
So far my code is;
for f in *.txt do sed -i 's/$/'" $f"'/' "$f" done
This works fine except that the filenames are appended on the line below, and not to each row. I am using Ctrl-V Tab to insert my tab in the console.