I’ve a file like this:
"text I don't know" command other "text"
"some" different text "type"
I need to obtain “text I don’t know” and “some”, with sed, awk or whatever bash tool, to be piped to another command.
Any hint?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
This seems overly simple, which means you may be new to awk. Which is perfectly acceptable, or I misintreprted your question. I hope its the former.
The following should do what you ask. Setting the field separator to ”
-F\"(escape the ” with ) and printing the second field, the first being to the left of “, or nothing. You can just put a pipe and the end of the line to do what you want.awk -F\" '{print FS$2FS}' inputFile.txtFS is Field Seperator