The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Advanced & Expert Users
.
google unix.com



UNIX for Advanced & Expert Users Expert-to-Expert. Learn advanced UNIX, UNIX commands, Linux, Operating Systems, System Administration, Programming, Shell, Shell Scripts, Solaris, Linux, HP-UX, AIX, OS X, BSD.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Parse for errors shell script bubba112557 Shell Programming and Scripting 2 04-02-2009 12:25 PM
Help!!! Shell script to parse data file. yajaykumar Shell Programming and Scripting 3 09-24-2008 07:19 AM
Unix shell script to parse the contents of comma-separated file KrishnaSaran Shell Programming and Scripting 11 06-20-2008 06:43 AM
Parse a string in XML file using shell script ayhanne Shell Programming and Scripting 46 01-09-2008 12:33 PM
How to parse config variables from external file to shell script pradsh Shell Programming and Scripting 2 07-09-2007 03:21 PM

Reply
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 08-26-2009
sais sais is offline
Registered User
  
 

Join Date: Dec 2007
Posts: 36
shell script to parse html file

hi all,

i have a html file something similar to this.
Code:
<tr class="evenrow">
<td class="data">added</td><td class="data">xyz@abc.com</td>
<td class="data">filename.sql</td><td class="modifications-data">08/25/2009 07:58:40</td><td class="data">Added TK prof script</td>
</tr>
<tr class="oddrow">
<td class="data">added</td><td class="data">xyz@abc.com</td><td class="modifications-data">filename2.sql</td><td class="modifications-data">08/25/2009 07:58:40</td><td class="data">Added TK prof script</td>
</tr>
and so till filname100.sql..
i need to fetch the "filename1-100.sql" ... the rest of the html can be ignored ... can anyone help me out with doing this.

Last edited by vgersh99; 08-26-2009 at 12:05 PM.. Reason: code tags, PLEASE!
  #2 (permalink)  
Old 08-26-2009
vgersh99's Avatar
vgersh99 vgersh99 is online now Forum Staff  
Moderator
  
 

Join Date: Feb 2005
Location: Boston, MA
Posts: 5,122
To keep the forums high quality for all users, please take the time to format your posts correctly.

First of all, use Code Tags when you post any code or data samples so others can easily read your code. You can easily do this by highlighting your code and then clicking on the # in the editing menu. (You can also type code tags [code] and [/code] by hand.)

Second, avoid adding color or different fonts and font size to your posts. Selective use of color to highlight a single word or phrase can be useful at times, but using color, in general, makes the forums harder to read, especially bright colors like red.

Third, be careful when you cut-and-paste, edit any odd characters and make sure all links are working property.

Thank You.

The UNIX and Linux Forums

---------- Post updated at 11:10 AM ---------- Previous update was at 11:06 AM ----------

assuming all the 'files' you're interested in are '.sql' files:
Code:
nawk -F'[<>]' '{for(i=1;i<=NF;i++) if($i ~ /.sql$/) print $i}' myHTMLfile.html
Reply

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 02:27 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0