I can chain multiple sed substitutions and a awk operation to achieve this, but is there a single sed substitution that can do it?
Also is there any other tool that is more suitable for this parsing task?
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.
You could try:
If you don’t know the
rec:idetc in advance but you know there’s three, you could try:If you don’t know how many
&name=valuepairs you’re after in advance but want to output all the values, you could try something like:where the
-Pmeans ‘perl regex’, the regex says “find the string followed by an&(or end of string) and preceded by and equals sign”, the-omeans to print just the matches (ie the 1, zz, and 21) each on their own line, and the| xargsmoves these from their own line to one line and space separated (ie1\nzz\n21to1 zz 21).