Recent Changes - Search:

OTRR Wiki Home Page

Old Time Radio Researchers Group


FirstLines /
21stPrecinct
AbbottAndCostello
Firstlines? /
Abbottandcostello
FirstLines /
AirAdventuresJimmieAllen
AldrichFamily
AllStarWesternTheatre
AmosAndy
ArchieAndrews
Blondie
BoldVenture
BoldVentureZIVSequence
BostonBlackie
Box13
BulldogDrummond
Contribs
Counterspy
DangerDoctorDanfield
DangerousAssignment
DangerousAssignmentBackup
DannyKayeShow
DimensionX
DuffysTavern
FredAllenFredAllenShow
FredAllenHourOfSmiles
FredAllenLinitBathClubRevue
FredAllenSaladBowlRevue
FredAllenSalHepaticaRevue
FredAllenShow
FredAllenShowOneLog
FredAllenTexacoStarTheater
FredAllenTownHallTonight
FrontierGentleman
GreatGildersleeveHaroldPeary
GreatGildersleeveWillardWaterman
Gunsmoke
HallsOfIvy
HaveGunWillTravel
HomePage
InnerSanctum
JackBennyProgram01
JackBennyProgram02
JackBennyProgram03
JackBennyProgram04
JackBennyProgram05
JonathanThomasChristmasOnTheMoon
LineUp
LukeSlaughter
LumAndAbner1
ManCalledX
MrMrsNorth
OnStage
OzzieAndHarriet
PatNovakForHire
ProudlyWeHail
RadioGOLDINdex
RichardDiamond
RichardDiamondPrivateDetective
RoguesGallery
StewartMessage
SuspensePartOne
SuspensePartTwo
TemplateScript
ThatHammerGuy
TheAdventuresOfSuperman
TheAdventuresOfSupermanPageEight
TheAdventuresOfSupermanPageFive
TheAdventuresOfSupermanPageFour
TheAdventuresOfSupermanPageOne
TheAdventuresOfSupermanPageSeven
TheAdventuresOfSupermanPageSix
TheAdventuresOfSupermanPageThree
TheAdventuresOfSupermanPageTwo
TheaterFive
TheCoupleNextDoor01
TheGreenHornet
TheGreenHornetPageFour
TheGreenHornetPageOne
TheGreenHornetPageThree
TheGreenHornetPageTwo
TheHallsOfIvy
TheManCalledX
TheSixShooter
VicAndSade
WildBillHickok
YouBetYourLife


CertFirstLines /
AddressUnknown
BabeRuthCollection
BarrieCraigConfidentialInvestigator
BarrieCraigConfidentialInvestigatorPage01
BarrieCraigConfidentialInvestigatorPage02
BarrieCraigConfidentialInvestigatorPage03
BarrieCraigConfidentialInvestigatorPage04
BarrieCraigConfidentialInvestigatorPage10
BarrieCraigConfidentialInvestigatorPage15
BarrieCraigConfidentialInvestigatorPage99
BarrieCraigConfidentialInvestigatorPageFooter
BehindTheScene
BigShow
BlackMuseum
BlairOfTheMounties
BlueBeetle
Box13
BrightStar
BroadwaysMyBeat
BroadwaysMyBeatFooter
BroadwaysMyBeatPage01
BroadwaysMyBeatPage02
BroadwaysMyBeatPage03
BroadwaysMyBeatPage10
BroadwaysMyBeatPage15
BroadwaysMyBeatPage99
CandyMatsonYukon28209
CaseDismissed
CavalcadeOfAmerica
CavalcadeOfAmericaPage01
CavalcadeOfAmericaPage02
CavalcadeOfAmericaPage03
CavalcadeOfAmericaPage04
CavalcadeOfAmericaPage05
CavalcadeOfAmericaPage06
CavalcadeOfAmericaPage07
CavalcadeOfAmericaPage08
CavalcadeOfAmericaPage10
CavalcadeOfAmericaPage15
CavalcadeOfAmericaPage99
CavalcadeOfAmericaPageFooter
CavalcadeOfKings
Chase
ChetChettersTalesFromTheMorgue
CinnamonBear
CloakAndDagger
ClydeBeattyShow
CrimeClassics
CruiseOfThePollParrot
DangerouslyYours
DangerWithGrainger
DarkFantasy
DayOfTheTraffids
DevilAndMrO
Dragnet
DragnetPage01
DragnetPage02
DragnetPage03
DragnetPage04
DragnetPage10
DragnetPage15
DragnetPage99
DragnetPageFooter
DrJekyllAndMrHyde
FalconTheAdventuresOfThe
FalconTheAdventuresOfTheFooter
FalconTheAdventuresOfThePage01
FalconTheAdventuresOfThePage02
FalconTheAdventuresOfThePage03
FalconTheAdventuresOfThePage04
FalconTheAdventuresOfThePage05
FalconTheAdventuresOfThePage06
FalconTheAdventuresOfThePage10
FalconTheAdventuresOfThePage15
FalconTheAdventuresOfThePage99
FamilyDoctor
FatMan
FatManFooter
FatManPage01
FatManPage02
FatManPage03
FatManPage10
FatManPage15
FatManPage99
FifthHorseman
FireFighters
FiveMinuteMysteries
FortLaramie
FrontierGentleman
GoodNewsOf
GreenValleyLine
HallsOfIvy
HallsOfIvyFooter
HallsOfIvyPage01
HallsOfIvyPage10
HallsOfIvyPage15
HelloAmericans
HillbillyBoys
HomePage
IncredibleButTrue
InTheNameOfTheLaw
ItSticksOutHalfAMile
LetGeorgeDoIt
LetGeorgeDoItFooter
LetGeorgeDoItPage01
LetGeorgeDoItPage02
LetGeorgeDoItPage03
LetGeorgeDoItPage04
LetGeorgeDoItPage10
LetGeorgeDoItPage15
LetGeorgeDoItPage99
LukeSlaughterOfTombstone
MayorOfTheTown
MrKeenTracerOfLostPersons
MrPresident
MysteryHouse
NeroWolfeTheNewAdventuresOf
Nightwatch
PhilipMarloweBBC
PhilipMarloweTheAdventuresOf
PhilipMarloweTheAdventuresOfFooter
PhilipMarloweTheAdventuresOfFootnote
PhilipMarloweTheAdventuresOfPage01
PhilipMarloweTheAdventuresOfPage02
PhilipMarloweTheAdventuresOfPage03
PhilipMarloweTheAdventuresOfPage10
PhilipMarloweTheAdventuresOfPage15
PhilipMarloweTheAdventuresOfPage90
PhilipMarloweTheAdventuresOfPage99
PhilipMarloweTheAdventuresOfSpecialNote
PhiloVance
PlanetMan
PoliceHeadquarters
PopeyeTheSailor
PrivateFilesOfRexSaunders
QuietPlease
RadioHallOfFame
RedBookDramas
RichardDiamondPrivateDetective
RockyFortune
SamSpadeTheAdventuresOf
SealedBook
SecretAgentK7
SecretsofScotlandYard
ShellChateau
SherlockHolmesConwayAndBruce
SherlockHolmesRathboneAndBruce
SilentMen
SixShooter
SkyKing
SmithsOfHollywood
StandByForCrime
StrokeOfFate
Whitehall1212
WorldAdventurersClub
YoursTrulyJohnnyDollar
YoursTrulyJohnnyDollarFooter
YoursTrulyJohnnyDollarPage01
YoursTrulyJohnnyDollarPage02
YoursTrulyJohnnyDollarPage03
YoursTrulyJohnnyDollarPage04
YoursTrulyJohnnyDollarPage05
YoursTrulyJohnnyDollarPage06
YoursTrulyJohnnyDollarPage07
YoursTrulyJohnnyDollarPage08
YoursTrulyJohnnyDollarPage09
YoursTrulyJohnnyDollarPage10
YoursTrulyJohnnyDollarPage11
YoursTrulyJohnnyDollarPage12
YoursTrulyJohnnyDollarPage99

Template Script

Here is the script I use to create the First Line Templates out of the Otter Log Database Files.

Basically, an entry in the original Otter Log would look like this (Taken from Abbot and Costello):
* 42/10/08    14 Cousin Yugo Gets Married

The script turns that into:

Date Aired : 42/10/08
Episode Number : 14
Available : YES
Title/Plot/Host: Cousin Yugo Gets Married
First Line :

While fully functional, there is definitely room for improvement.

One thing that may improve the script would be to do some kind of pre-formatting on the episode entries (perhaps all the text before the ':' could be bold; maybe a different color to help it stand out when scrolling down the page.).

Also of vital importance. If someone can figure out how to automatically merge updates of the otter log into the template, that would be awesome.

If anyone is able to write shell scripts and would like to improve this one (or convert it to perl, etc.), be my guest.

 
#!/bin/bash
#
## Version 1.2 - Now use only gawk to create template. No longer need sed to change output if episode is unavailable. 
## 
#
# This script takes one argument, the name of the Otter Database file you wish to convert into a template.
# The template is named First Lines-NameOfOtterLog.txt (where NameOfOtterLog.txt is the name of the otter log)
#  
# It is based on the fact that the format for the otter files are fixed 
# (based on the file "Creating a Log File.txt" from groups.yahoo.com/groups/otter-project)
#
# What the script does:
# 1) replaces the blank space indicating the show is not known to exist with a hyphen. (makes a backup of the original)
# 2) replaces 6 blank lines ("      ") with 2 blank lines and 4 hyphens (" ---- ") 
#	-> This is for the programs that don't have episode numbers.
# 3) formats the information into the template (a file that starts with the words: "First Line-"
# 4) Trims fields from unavailable episodes. 
# 5) restores original log file
#
#
### Otter Database Format
#
#Column 1  * Indicates that the episode is known to exist
#         <space> Indicates that the episode is not known to exist
#
#Column 3-4  Two digit Year (yes we know it's not year 2000 compliant)
#
#Column 5   / (the slash character) or a <space>
#
#Column 6-7  Two digit Month
#
#Column 8  / (the slash character) or a <space>
#
#Column 9-10 Two digit Day
#
#Column 11 <space>
#
#Column 12-15  Episode number (if known). Use leading spaces.
#
#Column 16 <space>
#
#Column 17-45  Episode title 
#
### End Otter Database Format

# make sure a file to convert is used.

if [[ $# -lt 1 ]];then
	echo "Error: No file to convert."
	echo; echo "Use the program like this:" 
	echo "$0 otter_log.txt"
	echo "Where otter_log.txt is the name of the otter log you wish to convert."
	exit 1
fi

### set some variables for use throughout the script
OTTERLOG=""$*""
FIRSTLINETEMPLATE=First\ Lines-"${*}"

# replaces the blank space indicating the show is not known to exist with a hyphen.
# (makes a backup of the original).
sed -i~ s/^' '/'-'/ "$OTTERLOG"

# replaces 6 blank lines ("      ") with 2 blank lines and 4 hyphens (" ---- ") 
# This is for the programs that don't have episode numbers.
sed -i s/'      '/' ---- '/ "$OTTERLOG"


### Creating the template ###
# splits otter log into 8 fields:
# $1 --> episode availability (1 character)
# $2 --> blank space (1 character)
# $3 --> date (8 characters)
# $4 --> blank space (1 character)
# $5 --> episode number (4 characters)
# $6 --> blank space (1 character)
# $7 --> title (up to 280 characters)

# it is very easy to edit things into the template.
# Just add whatever you want (synopsis, AKA's, etc) before the line: {printf "\n\n"}' "$OTTERLOG" > "$FIRSTLINETEMPLATE"

# The format to add a line is as follows (without the quotes):
# - line must start with "{print"
# - any fixed text that you want to put in the line must be enclosed in quotes
# - to add the information from one of the fields, put the field number (with the dollar sign), outside the quotes.
# - end the line with a close braces --> }
#
# Example: to add a field for a Synopsis, just add this to the line before {printf "\n\n"}' "$OTTERLOG" > "$FIRSTLINETEMPLATE"
# {print "Synopsis       : "}

gawk 'BEGIN{ FIELDWIDTHS = "1 1 8 1 4 1 280" };
{if ( $1 == "'*'" )
	print "%PURPLE%Date Aired     : " $3
 else print "Date Aired     : " $3}
{print "Episode Number : " $5}
{if ( $1 == "'*'" )
	print "Available      : YES"
 else print "Available      : NO"}
{if (( $7 != "" ) || ( $1 == "'*'" ))
	print "Title/Plot/Host: " $7}
{if ( $1 == "'*'" )
	print "First Line     : "}
{printf "\n\n"}' "$OTTERLOG" > "$FIRSTLINETEMPLATE"

# restore original log file
if [[ $? == 0 ]];then
	bak="${OTTERLOG}~"
	mv "$bak" "$OTTERLOG"
fi

Attach:First_Line_Script_v1-2

Edit - History - Print - Recent Changes - Search
Page last modified on July 06, 2005, at 02:33 PM