LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 10-27-2006, 05:53 PM   #1
metalx1000
Member
 
Registered: Jun 2006
Distribution: Debian
Posts: 112

Rep: Reputation: 16
the 'cut' command and HTML


OK,
I have a file named 'data' that looks like this:
Code:
Cookies:34:Brakefast:54:345:34:banna, chips, milk:cook it good.:I like it.
cake:37:Dessert:22:45:4:milk, sugar:bake it good.:I love it.
Raps:23:Dinner:42:65:12:meat, raps, mayo:Make it and rap it.:Yumm Yumm
and I know how to use the 'cut' command like follows
Code:
$ cut -d: -f7 data
banna, chips, milk
milk, sugar
meat, raps, mayo
$ cut -d: -f3,4 data
Brakefast:54
Dessert:22
Dinner:42
But, what I'd like to do is write a script that takes the file and converts it to and HTML file that looks something like this:
Code:
<big><big><span style="font-weight: bold;">Cookies</span></big></big><br>
34 Brakefast<br>
54 345 34<br style="font-weight: bold;">
<br style="font-weight: bold;">
<span style="font-weight: bold;">Notes</span><br>
banna, chips, milk<br>
cook it good.<br>
I like it.<br>
<hr><big><big><span
 style="font-weight: bold;">cake</span></big></big><br>
37 Dessert<br>
22 45 4 <br>
<br>
<span style="font-weight: bold;">Notes</span><br>
milk, sugar<br>
bake it good.<br>
I love it.<br>
<hr><big><big><span
 style="font-weight: bold;">Raps</span></big></big><br>
23 Dinner<br>
42 65 12<br>
<br>
<span style="font-weight: bold;">Notes</span><br>
meat, raps, mayo <br>
Make it and rap it.<br>
Yumm Yumm
<hr>
It doesn't have to be exactly like that, but something just to get me started.

thanks
 
Old 10-27-2006, 08:50 PM   #2
petersum
Member
 
Registered: May 2006
Location: Karachi, Pakistan
Posts: 140

Rep: Reputation: 15
I don't think anyone here has the time to give you a full tutorial on script writing.

I would suggest that you learn python, perl or rebol.
Python is easiest and quickest to learn and should already be on your computer. Perl is much more versatile, in my opinion, but takes a good time to master. Rebol is a lesser known language that is surprisingly simple.

You might also update your knowledge of HTML to XHTML, as you seem to be using tags which are fast becoming absolete.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I cut out a specific piece of a html page (using sed/awk or similar)? bomix Linux - General 2 10-08-2005 04:30 PM
finger and cut command Craig Bowes Linux - Newbie 3 10-09-2004 12:49 PM
Cut Command Help!! fooforon Programming 2 02-05-2004 10:09 AM
cut / awk command?? Sammy2ooo Linux - Newbie 1 05-27-2003 05:46 PM
Easy: Help with Cut command Krash_io Programming 4 07-17-2002 02:29 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 12:41 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration