In what exact way "its not working"?
Any error messages?
What happens?
I see you're using gsub. Are you sure there's something to substitute you're specifying in gsub?
Are you sure your csv is tab-delimited?
Have tried specifying FS to awk as 'tab'?
Any "weird" chars in your csv file? (what does cat -vet myFile.csv say?)
Anything else you've tried to troubleshoot your issue?
Thanks for your help! I removed the ",$2" in the first command and it worked. With that I wanted to specify the column number instead of the whole file.
Well, if you don't specify the third argument to gsub, it defaults to $0 (the whole record/line).
Something is not right with your input data. Or it's not what you think it's
I edited my question. You are right its not a tab-delimited file. I was mixing it up with another one.
So, the input file has three columns:
sample-id,absolute-filepath,direction
I wanted to change the contents of "absolute-filepath" from "/mnt/data/code/analysis_tree/data/processed/16S/shi7_learning/fastqs_stitched/" to "/home/irshad/ihaq/rawdata"