Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Legendary clubmaker Roger Cleveland raised the bar once again with the new X-Forged Wedges. Designed with input from Tour players, they are constructed from soft 1020 carbon steel for incredible feel. The clubs also feature a tighter heel-toe radius that provides increased versatility from anywhere around the green. </td>
</tr>
<tr>
<td>
Price: $109.00 <a href="">Buy/More Info</a>
</td>
</tr>
</table>
</description>
</item>
I would love to learn how to separate important information, I want to determine how many categories there are, I tried using grep but I couldn't get it to work.
Couldn't grep be used with a wild card to identify all of the categories within this large file? something like "<category>*</category>"
I would also like to identify products that are less then $100, how can both of these things be done?
Otherwise this looks strongly like an xml-file. I'd suggest to use a scripting language like perl which comes with a package for scanning xml-files (http://xml.coverpages.org/perl-xml-faq11.html). This will help you if you have to do something more elaborate than simply find lines in such a file.
WoW!! You guys are really helpful, by any chance, could someone help me figure out how to write a perl script that will help me with these large data files?
I need a perl script that can determine...
1. How many different categories there are, I need a number. And also display all the different categories on the terminal, not displaying any category more then once.
2. Extract all of the categories I specify along with the product associated with the categories (all of the xml) into a separate file.
I'm seriously not a programmer, I've used linux for years, but still I can't program, I don't think this script would be that hard? Can someone help me with it?
nobody is a programmer at first. All we ever did was read the docs and practice! If you want to program in Perl, read the docs and start to learn it. See my sig for Perl doc link.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.