danastasio
February 21st, 2010, 07:22 PM
Alright, I am writing a program to interface with the Arch Linux AUR for a friend. I need help with grep. So far as I can tell, the only way to actually search the thing is to download the HTML code and grep the information out of it. The problem I have is when you run
grep packages.php?ID=
(grepping just the package name gives stuff you dont need "packages.php?ID=" only shows up in the lines with the package names)
it returns this:
<td class='data1'><span class='f4'><a href='packages.php?ID=20401'><span class='black'>python-yolk 0.4.1-1</span></a></span></td>
In this particular case, "Python-yolk 0.4.1" is the only thing that I am interested in. Is there any way that I can grep just that out of a file without getting the whole line?
I probably worded this poorly, so let me know if I can restate anything :)
grep packages.php?ID=
(grepping just the package name gives stuff you dont need "packages.php?ID=" only shows up in the lines with the package names)
it returns this:
<td class='data1'><span class='f4'><a href='packages.php?ID=20401'><span class='black'>python-yolk 0.4.1-1</span></a></span></td>
In this particular case, "Python-yolk 0.4.1" is the only thing that I am interested in. Is there any way that I can grep just that out of a file without getting the whole line?
I probably worded this poorly, so let me know if I can restate anything :)