Hi everyone, this is my first post here, I hope someone can help me.
I have a file which I need to delete characters '_F3' from the end of the text in the first column. The problem is that the characters may also occur elsewhere in the file (i.e. second columns onwards). I tried sed (thinking I was a linux genius) and then realised that there were rows where the character is not in the first column, but appears in a later column, and I was deleting the second occurrence of '_F3' when I only actually want to delete it if it is in the first column.
The command I was using was:
sed 's/_F3//' filename > newfilename
I need to retain everything in the file except the trailing _F3 in the first column, and write to a new file.
I have spent ~3h trying to find a solution to this, and think its probably an awk command I need, but I am afraid my awk skills are 0. :wall:
Yes that has worked, but unfortunately I seem to have lost the formatting of my file now. I think it was tab delimited before, now it just has a blank space between columns, and my next process wont accept this.