[comp.sources.misc] v16i096: Awk programs to manage a CD index, Part01/01

ajayshah@alhena.usc.edu (Ajay Shah) (02/08/91)

Submitted-by: Ajay Shah <ajayshah@alhena.usc.edu>
Posting-number: Volume 16, Issue 96
Archive-name: cd-index/part01

Iff you feel like computer-indexing CDs.
Includes my list; you might save some typing by just deleting gunk
you don't have.

Ajay Shah

#! /bin/sh
# This is a shell archive.  Remove anything before this line, then feed it
# into a shell via "sh file" or similar.  To overwrite existing files,
# type "sh file -c".
# The tool that generated this appeared in the comp.sources.unix newsgroup;
# send mail to comp-sources-unix@uunet.uu.net if you want that tool.
# If this archive is complete, you will see the following message at the end:
#		"End of archive 1 (of 1)."
# Contents:  index.cd pass1.awk pp.awk read.me
# Wrapped by kent@sparky on Sun Feb  3 15:23:09 1991
PATH=/bin:/usr/bin:/usr/ucb ; export PATH
if test -f 'index.cd' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'index.cd'\"
else
echo shar: Extracting \"'index.cd'\" \(6266 characters\)
sed "s/^X//" >'index.cd' <<'END_OF_FILE'
X
X; This file is the index to our CDs.
X
X; File format:
X;	blank lines are ok, and don't count,
X; 	comments starting with semicolon just like csh/awk uses #
X;	pipe-seperated fields as follows:
X;		$1 == author
X;		$2 == title
X;		$3 == comments if any
X
XAC/DC|Back in Black|
XAerosmith|Pump|
XAerosmith|Permanant Vacation|
XAir Supply|Greatest Hits|
X
XBach|Concerto in F Major & Partita #1|Vienna Masters
XBach|Violin Concerto in D Minor & A Minor and E Major|Vienna Masters
XBach|Organ Works #1|Vienna Masters
XBach|Organ Works #2|Vienna Masters
XBach|Brandenburg Concertos #1,2,3|Vienna Masters
XBach|Brandenburg Concertos #4,5,6|Vienna Masters
XBad Company|10 from 6|
XBeatles|Rubber Soul|
XBeethoven|Piano Concerto #1 & Overture from King Stephan|Vienna Masters
XBeethoven|Piano Concerto #3 & Overture to Fidelio|Vienna Masters
XBeethoven|Symphony #5 & Schubert's Symphony #8|Vienna Masters
XBeethoven|Moonlight, Waldstein and Pathetique Piano Sonatas|Vienna Masters
XBeethoven|Symphony #2 & the Egmont Overture|Vienna Masters
XBerlin|The best of, 1979-88|
XBizet|L'Arlesienne Suite #1 and #2 & Symphony #1|Vienna Masters
XBlack Sabbath|Greatest Hits|
XBrahms|Hungarian Dances #1-21|Vienna Masters
XEddie Brickell and the New Bohemians|Shooting Rubberbands at the Stars|
XBruch|Violin Concerto #1 & Mendelssohn Violin Concerto in E Minor|Vienna Masters
X
XThe Cars|Greatest Hits|
XCheap Trick|Lap of Luxury|
XChopin|Piano Music Vol#1|Vienna Masters
XChopin|Piano Music Vol#2|Vienna Masters
XChopin|Piano Music Vol#3|Vienna Masters
XChopin|Piano Music Vol#4|Vienna Masters
XCCR|Chronicles|
XCSNY|So Far|
XCSNY|Deja Vu|
X
XDeep Purple|Machine Head|
XDef Leppard|Hysteria|
XDire Straits|Alchemy Part 1|
XDire Straits|Alchemy Part 2|
XDire Straits|Brothers in Arms|
XDvorak|Stabat Mater, Opus 58|Vienna Masters
XEagles|Desperado|
XEagles|Hotel California|
XEagles|One of these nights|
XEagles|The Long Run|
XELP|The best of|
X
XFleetwood Mac|Rumours|
XPeter Frampton|Frampton Comes Alive Vol 1|
XPeter Frampton|Frampton Comes Alive Vol 2|
X
XGeorgia Satellites|In the Land of Salvation and Sin|
XGiant|Innocent Days|CD Single
XGreat White|...Twice Shy|
X
XHaydn|Symphony #22, 26, 53|Vienna Masters
XHaydn|The Emperor Quartet|Vienna Masters
XHaydn|String Quartets Opus 64, #1-3|Vienna Masters
XHaydn|String Quartets Opus 64, #4-6|Vienna Masters
XHaydn|Symphony #6,7,8|Vienna Masters
XDon Henley|Building the Perfect Beast|
XDon Henley|The End of Innocence|
XVarious|Hit Singles 80-88|Contains ``Against all Odds'', BTW
XHolst|The Planets|
X
XJoan Jett|The Hit List|
XElton John|Greatest Hits|
XElton John|Live in Australia|
XJanis Joplin|Greatest Hits|
XJourney|Greatest Hits|
XJungle Book|Soundtrack|
X
XKansas|The best of|
XKix|Blow my Fuse|
XCyndi Lauper|She's So Unusual|
X
XLed Zeppelin|Boxed Set #1|
XLed Zeppelin|Boxed Set #2|
XLed Zeppelin|Boxed Set #3|
XLed Zeppelin|Boxed Set #4|
XLed Zeppelin|Led Zeppelin|(Led Zep I)
XLed Zeppelin|Led Zeppelin II|
XLed Zeppelin|Led Zeppelin III|
XLed Zeppelin||(Led Zeppelin IV)
XLed Zeppelin|Houses of the Holy|
XLed Zeppelin|In through the out door|
XLed Zeppelin|Physical Graffiti|
XLiszt|Symphonic Poems|Vienna Masters
XLittle Feat|Let it Roll|
XThe Little Mermaid|Soundtrack|
XLynyrd Skynyrd|Skynyrd's Innyrds|
X
XRichard Marx||
XMendelssohn|Symphony #4,5|Vienna Masters
XMetallica|...And Justice for All|
XJoni Mitchell|Blue|
XMozart|Masterpieces Vol 1; Symphonies|
XMozart|Masterpieces Vol 2; Piano Concertos|
XMozart|Masterpieces Vol 3; Concertos for violin, horn, flute and harp|
XMozart|Masterpieces Vol 4; Serenades and Divertimentos|
XMozart|Masterpieces Vol 5; Overtures, choruses, arias, songs|
XMozart|String Quartet Vol 1|Vienna Masters
XMozart|String Quartet Vol 2|Vienna Masters
XMozart|Symphonies #22, 24, 29|Vienna Masters
XMozart|Clarinet Concerto in A major|Vienna Masters
XMozart|Symphonies #21, 30, 33|Vienna Masters
XMozart|Symphonies #16, 18, 25|Vienna Masters
XMozart|Violin Concertos KV 218, 216|Vienna Masters
XMozart|Jupiter Symphony|Vienna Masters
XMozart|Symphonies #35, 38|Vienna Masters
XMozart|Clarinet Concerto, Flute and harp Concerto, Masonic Funeral March|
XAllanah Myles||
X
XJimmy Page|Outrider|
XTom Petty and the Heartbreakers|Long after dark|
XTom Petty and the Heartbreakers|Hard Promises|
XTom Petty and the Heartbreakers|Damn the Torpedoes|
XTom Petty|Full Moon Fever|
XPink Floyd|Wish you were here|
XPink Floyd|Dark Side of the Moon|
XPink Floyd|The Wall|
XThe Police|Synchronicity|
X
XRavel|Bolero & Piano Concerto in G major|Vienna Masters
XChris Rea|The Road to Hell|
XRimsky-Korsakov|Scheherazade|
XRobbie Robertson||belongs to CJain
XRush|A show of hands|Live
XRush|Presto|
X
XJoe Satriani|Flying in a blue dream|
XScarlatti|Sonatas|Vienna Masters
XSchubert|Quintet in A major "The Trout"|Vienna Masters
XSchubert|String Quartet in D minor "Death and the Maiden"|Vienna Masters
XScorpions|World Wide Live|
XScorpions|Savage Amusement|
XBob Seger & the Silver Bullet Band|Nine Tonight|
XSimon & Garfunkel|Greatest Hits|
XMisc|Soundtrack Smashes - The 80's|
XMisc|80 Spectacular Sound Effects|
XBruce Springsteen & the E Street Band|Live 75-85, Vol 1|
XBruce Springsteen & the E Street Band|Live 75-85, Vol 2|
XBruce Springsteen & the E Street Band|Live 75-85, Vol 3|
XStrauss|Unforgettable Melodies Vol 1|Vienna Masters
XStrauss|Unforgettable Melodies Vol 2|Vienna Masters
XStrauss|Unforgettable Melodies Vol 3|Vienna Masters
XStravinsky|Petrouchka or the Firebird Suite|
X
XJames Taylor|Greatest Hits|
XTchaikovsky|Symphony #1, op. 13|
XTchaikovsky|Concerto #1, op. 23 & Concerto for violin and orchestra in D major, op. 35|
XTchaikovsky|Symphony #5|Vienna Masters
XTchaikovsky|Pathetique|Vienna Masters
XTchaikovsky|Nutcracker Suite|Vienna Masters
XTchaikovsky|Romeo & Juliet|Vienna Masters
XTesla|The Great Radio Controversy|
XTiffany||Contains "Could've been"
XToto|Toto IV|
XTraffic|The Low Spark of High-heeled Boys|
XTraffic|John Barleycorn must die|
X
XU2|The Unforgettable Fire|
XU2|The Joshua Tree|
XUFO|The Best of|
X
XVan Halen|1984|
XVivaldi|The Four Seasons|Vienna Masters
XVivaldi|Concertos on authentic instruments|Vienna Masters
XVivaldi|Famous Concertos|Vienna Masters
X
XWarrant|Dirty, Rotten, Filthy, Stinking Rich|
XWebber|The Phantom of the Opera|Highlights
XWhitesnake|Slip of the Tongue|
XThe Who|Face Dances|
XThe Who|Who's better, Who's best|
XSteve Winwood|Roll with it|
XSteve Winwood|Back in the high life|
X
XYes|Fragile|
END_OF_FILE
if test 6266 -ne `wc -c <'index.cd'`; then
    echo shar: \"'index.cd'\" unpacked with wrong size!
fi
# end of 'index.cd'
fi
if test -f 'pass1.awk' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'pass1.awk'\"
else
echo shar: Extracting \"'pass1.awk'\" \(190 characters\)
sed "s/^X//" >'pass1.awk' <<'END_OF_FILE'
X# this awk program starts at the CD index file and delivers an output
X# which meets the following properties:
X#
X#	no comments
X#	no blank lines
X
XBEGIN {FS = ";"}
X
X(length($1) > 0) {print $0}
END_OF_FILE
if test 190 -ne `wc -c <'pass1.awk'`; then
    echo shar: \"'pass1.awk'\" unpacked with wrong size!
fi
# end of 'pass1.awk'
fi
if test -f 'pp.awk' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'pp.awk'\"
else
echo shar: Extracting \"'pp.awk'\" \(340 characters\)
sed "s/^X//" >'pp.awk' <<'END_OF_FILE'
X#
X# pretty printer for database
X#
X# key assumption: input stream contains no comments, no blank lines
X#
XBEGIN {FS = "|"}
X{
X    if (length($3) > 0) {
X        if ($3 ~ /Vienna Masters/) print $2 ", " $1;
X                              else print "\"" $2 "\" by " $1;
X        print $3;
X    }
X    else print "\"" $2 "\" by " $1;
X    print "";
X}
END_OF_FILE
if test 340 -ne `wc -c <'pp.awk'`; then
    echo shar: \"'pp.awk'\" unpacked with wrong size!
fi
# end of 'pp.awk'
fi
if test -f 'read.me' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'read.me'\"
else
echo shar: Extracting \"'read.me'\" \(150 characters\)
sed "s/^X//" >'read.me' <<'END_OF_FILE'
X
XAdding/deleting lines is trivial.
X
XTo count:
X	awk -f pass1.awk index.cd | wc -l
X
XTo print clean listing:
X	awk -f pass1.awk index.cd | awk -f pp.awk
X
END_OF_FILE
if test 150 -ne `wc -c <'read.me'`; then
    echo shar: \"'read.me'\" unpacked with wrong size!
fi
# end of 'read.me'
fi
echo shar: End of archive 1 \(of 1\).
cp /dev/null ark1isdone
MISSING=""
for I in 1 ; do
    if test ! -f ark${I}isdone ; then
	MISSING="${MISSING} ${I}"
    fi
done
if test "${MISSING}" = "" ; then
    echo You have the archive.
    rm -f ark[1-9]isdone
else
    echo You still need to unpack the following archives:
    echo "        " ${MISSING}
fi
##  End of shell archive.
exit 0
exit 0 # Just in case...
-- 
Kent Landfield                   INTERNET: kent@sparky.IMD.Sterling.COM
Sterling Software, IMD           UUCP:     uunet!sparky!kent
Phone:    (402) 291-8300         FAX:      (402) 291-4362
Please send comp.sources.misc-related mail to kent@uunet.uu.net.