home *** CD-ROM | disk | FTP | other *** search
- BEGIN {
- print "" > "o.tex"
- print "%--------------------------" > "o.tex"
- print "" > "o.tex"
- num_songs = 0;
- num_others = 0;
- }
-
- # $1 meaning
- # -- ---------------------------------------------------------------------
- # k KEY, short, only one word, namely $2
- # t TITLE
- # a AUTHOR / ARTIST
- # s SONG (up to 14 on a side, or more if you use a smaller latex font)
- # o OTHER stuff to put on the back flap of the label or for db search
- # c COMMENT db search text will not appear on the cassette label
- # e END-OF-ENTRY (very very important)
- #
- #
- #
-
- {
- if (( $1 == "k" ) || ( $1 == "K" )) {
- key = $2
- } else if (( $1 == "s" ) || ( $1 == "S" )) {
- num_songs++
- for (i=2; i<=NF; i++) {
- song[num_songs] = song[num_songs] " " $i
- }
- } else if (( $1 == "t" ) || ( $1 == "T" )) {
- for (i=2; i<=NF; i++) {
- title = title " " $i
- }
- } else if (( $1 == "a" ) || ( $1 == "A" )) {
- for (i=2; i<=NF; i++) {
- author = author " " $i
- }
- } else if (( $1 == "o" ) || ( $1 == "o" )) {
- num_others++
- for (i=2; i<=NF; i++) {
- others[num_others] = others[num_others] " " $i
- }
- } else if (( $1 == "e" ) || ( $1 == "E" )) {
- if ( key == "" ) {
- print "Yo blood! Jeez, dude, like, ain't no KEY in theya!"
- key = "nokey"
- }
- o = "\\album{" key "}"
- if ( author == "" ) {
- print "Gaddangit blood, you plum forgit da AUTHOR mothalova"
- author = "No Artist"
- }
- o = o "{" author "\\\\"
- if ( title == "" ) {
- print "Sheeeeit, mothalova, you done forgit da TITLE ehyeshoel"
- title = "No Title"
- }
- o = o "{\\bf " title "}"
- print o > "o.tex"
- o = ""
- if (num_songs > 0) {
- print "\\begin{enumerate}" > "o.tex"
- for ( i=1; i<=num_songs; i++) {
- print "\\item " song[i] > "o.tex"
- song[i] = "";
- }
- print "\\end{enumerate}" > "o.tex"
- } else {
- print "{}" > "o.tex"
- }
- print "}" > "o.tex"
- print "{{\\bf " author "\\\\" title "}}" > "o.tex"
- if (num_others > 0) {
- print "{" > "o.tex"
- for (i=1 ; i<=num_others; i++) {
- print others[i] "\\\\" > "o.tex"
- others[i] = "";
- }
- print "}" > "o.tex"
- } else {
- print "{}" > "o.tex"
- }
- print "%--------------------------" > "o.tex"
- print "" > "o.tex"
- num_songs=0;
- num_others=0;
- key = "";
- title = "";
- author = "";
- } else if ((length($0) == 0) || ($1 == "c") || ($1 == "C")) {
- x="x";
- } else {
- print "Hey, dude. Like I just saw a weirdo line, skin. It be:"
- print $0
- }
- }
-