The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #7 (permalink)  
Old 11-24-2008
macxcool macxcool is offline
Registered User
  
 

Join Date: Nov 2008
Location: Canada
Posts: 4
Thank you all for your solutions. I'm going to use Christoph Spohr's because I'm more comfortable with sed than I am with awk (although I know it's very powerful). I get an output with spaces after the pipe because there are spaces at the beginning of the line. How can I modify
Code:
sed -n '/Application/{N;s/.*Application=\([^"]*\).*\n\(.*\)<.*/\1 | \2/p}' file
to get rid of those spaces.
Also, what if my input file has another line between the two lines in question:
Code:
    <tr> 
      <td height="23" align="default" valign="top"> 
        <a href="MasterDetailResults.asp?textfield=a&Application=3D Home Architect 4">3D Home Architect 4</a> </td>
      <td align="default" valign="top"> 
        Approved </td>
    </tr>
Once again, I need: Application Name|Status as my output. I've been removing the
<td align="default" valign="top">
line with sed before finishing things off with the sed code above.