So I have a text file with
"sam", "james", "john"
"luke", "polly", "jack"
I am looking for an awk command that will isolate each name. I seem to be running into the issue that awk does not like me setting " as the delimiter
I would like it to look like
sam
luke
if I were to try and print field 0
I have tried these commands
awk -F""" '{print $0}' test.txt
awk -F""" '{print $0}' test.txt
awk -F'"' '{print $0}' test.txt
awk -F'"' '{print $0}' test.txt
awk -F" '{print $0}' test.txt
None of those seems to have worked. This is my first time asking a question on here. Also started learning to code about 5 weeks ago as well 😀 so I hope this makes sense, isn’t a dumb question and that I formatted it all correctly!
2
Answers
With your shown samples please try following. Basically you need to print the correct field number here to get your expected output. That field number would be 2nd field.