![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| 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 |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
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> 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
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 |
| Display Modes | Rate This Thread |
|
|