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



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Ksh Storing Multiple Files and reading each line in each file. developncode UNIX for Dummies Questions & Answers 1 04-08-2008 04:44 PM
Reading Multiple Variables From a Single Line in Shell Drek Shell Programming and Scripting 14 12-21-2006 11:20 AM
Reading multiple lines as single braindrain Shell Programming and Scripting 9 10-18-2006 10:16 AM
mmap vs shared memory - which is faster for reading data between multiple process nmds High Level Programming 1 02-22-2005 04:02 AM
Searching multiple files with multiple expressions Anahka Shell Programming and Scripting 6 01-07-2004 06:24 PM

 
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
Prev Previous Post   Next Post Next
  #1 (permalink)  
Old 11-25-2006
underlig underlig is offline
Registered User
  
 

Join Date: Nov 2006
Posts: 1
Reading multiple tags from .asx files

Hi, I'm trying to wget a series of .asx files, read <title> and <ref> tags from them and then sending that information to wget.

asx files contains the following information
Code:
<ASX VERSION="3.0">
		<ENTRY>
		<STARTTIME Value="00:00:00.0" />
		<TITLE>title of the movie</TITLE>
		<REF HREF="mms://192.168.0.34/139254.wmv?string" />
		<REF HREF="http://192.168.0.34/139254.wmv?string" />
		</ENTRY>
</ASX>
The information i want out of the .asx files are bold in above code.
I've googled and searched unix.com and so far i've managed to do this:
Code:
#!/bin/bash
if [ $# -eq 0 ]; then
        echo "Usage: getfiles.sh <videoid>"
        exit 1
fi
videoid=$1
file1=$(wpro "http://192.168.0.34/$videoid.asx?string" -O "$videoid.tmp")
while read line; do
        title=`nawk '/<TITLE>/,/<\/TITLE>/'`
        #$title now contains the full <title>title of the movie</title> 
        referer=`nawk '/REF/,/>/'`
done <$videoid.tmp
Somehow $referer never get's set, if i comment out the title=`nawk-line then referer is set like it's supposed to.
Does nawk "BREAK" / finish the "while read line; do"-loop after the first hit?
If so, how can i restart from the top again?

And, final question, what would you do to get the information out of the .asx files, are there better ways than this (i'm sure there are).
 

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 05:13 PM.


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