Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

tab-delimited blues 1

Status
Not open for further replies.

pixelRONIN

Technical User
Apr 11, 2003
9
0
0
US
I'm in dire need of some assistance on parsing a txt file. I'm currently involved in redoing the website for a Community Supported Radio station here in Austin, TX.

The station's URL is: The new site that I'm developing is:

Login using:
user name = guest

password = password

The txt file I'm having the problem parsing is part of the play list area in the existing site:

This play list is generated by a software program called Music Librarian and is exported as a fixed-length txt file. Well, sort of. I think the txt file starts out as fixed-length then loses the fixed lengths. As you see below.

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Play Report




PLAY DATE: Tue, 04/01/2003
12:00 AM PROGRAM 69086A LOT OF NIGHT MUSIC + 8888888
12:01 AM PROGRAM 74191From the Beethoven Satellite Network + 8888888
6:00 AM PROGRAM 72473CLASSICS FROM THE KMFA LIBRARY + 8888888
6:01 AM Leopold Mozart 1736Trumpet Concerto Erato 55014



+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

I would like to clean out the header at the top of the page and parse out the 'PROGRAM' lines and to parse out the numbers prior to third field, ie 69086A LOT OF MUSIC, the 69086 needs to be taken out.

I would like to import this file into Access because I'm not very versed in VBScript, or any other scripting language for that matter. I'm a Graphic Artist learning Web skills to become more marketable - hence this pro-bono job.

I have attached the txt playlist file spewed out by Music Librarian, I have contact the Software vendors and got no help from them. Big surprise there!

Ideally, I need to write a parser that converts the present "whatever" delimited txt file into a comma separated file to import this file into Access.

This is a far as I have gotten in this process.


The program titles for the station are in a separate db, I would like to have the db create the table headers then VBScript parse in the songs associated to the program.

Is this too much to ask?

Let me know and I really appreciate any assistance you can give!

pR
 
Well as i see till now seems that first 2 segments are realy fixed length and they are on one line:
[12:00 AM ][PROGRAM ]69086A LOT OF NIGHT MUSIC
So i would sugest to use FSO object then use readline for getting each line to process.
i would do like this first, also miht be improved in some way what i'm doing here.

set fso=Server.CreateObject("Scripting.FileSystemObject")
set file=fso_OpenTextFile("c:\myfile.txt",ForReading)
size1=len("12:00 AM ")
size2=len("PROGRAM ")
while not file.AtEndOfStream
sline=file.ReadLine
stime=trim(left(sline,size1))
stype=trim(mid(sline,size1+1,size1+1+size2))
sline=mid(sline,size1+1+size2+1,len(sline))
wend

till now we have the time and type and the rest of the line wich seems not beeing fixed length.

maybe there is something you can provide about these separators between fields. Are they tab fields or any of this?
________
George, M
 
Hey,
Thanks for the prompt and useful reply. I was going nuts - my client at the station saw another classical radio station's Web site and in the URL there was a '/new' at the end of it. She turned to me and asked "Is that all you have to do - I mean type /new and you get a new Web site. Well, I hit the floor!
Anyway, here is a look at the txt file
I think you can get a clean look at the tab delimited fields, I think. I have tried to pull the file into Vedit to do block conversions - no luck. I have brought the file into SoftSilver Transformer to see if I could it translated into XML, no luck there either. I'm not sure what, if anything delimits the columns. Vedit sees the columns but cant parse it into comma delimiters. SoftSilver just spewed out an XML doc with too many rows with nondiscript columns. The proggy counldn't read the tabs I guess.
Here is the parser as I have it:
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
IF WRITING=TRUE AND LEN(TRIM(playlistArray(q)))>0 THEN
playTime=MID(playlistArray(q),1,9)
Composer=MID(playlistArray(q),10,32)
Piece=""
FOR s=42 TO LEN(playlistArray(q))-43
qq=MID(playlistArray(q),s,1)
IF qq="0" OR qq="1" OR qq="2" OR qq="3" OR qq="4" OR qq="5" OR qq="6" OR qq="7" OR qq="8" OR qq="9" THEN
Piece=Piece & MID(playlistArray(q),s,1)
ELSE
EXIT FOR
END IF
NEXT
Song=MID(playlistArray(q),42+LEN(Piece),40)
Label=MID(playlistArray(q),82+LEN(Piece),11)
Spine=MID(playlistArray(q),93+LEN(Piece),LEN(playlistArray(q))-92-LEN(Piece))
a=timeStripper(playTime)*1
b=timeStripper(programHeaderTable(pHT,1))*1
c=LastCheck*1
IF a>=b AND a<c THEN
qLength=qLength+1
z=ditties(playTime,Composer,Piece,Song,Label,Spine)
ELSE
EXIT FOR
END IF

END IF
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
You're right everything after the third column things go wiggy. The numbers prior to the composition is not realted to anything, some garbage from the software. So, I had to take those out as well. I used the length of each 'garbage' string to offset the length of the other two line items, namely the lable & spine# to use with the Amazon search engine.
Thanks so much George
 
I made a code with some tweaks and sems to work fine
Code:
<%
'Response.ContentType=&quot;application/vnd.ms-excel&quot;
set fso=Server.CreateObject(&quot;Scripting.FileSystemObject&quot;)
set file=fso.OpenTextFile(&quot;D:\Inetpub\[URL unfurl="true"]wwwroot\test\apr03.txt&quot;)[/URL]
size1=len(&quot;      12:00 AM &quot;)
size2=len(&quot;PROGRAM                        &quot;)
size3=len(&quot;Parisian Quartet No. 10 (Nouveau No.  4)&quot;)
%>
<table border=1>
<%
function getLastNum(stext)
	s=&quot;&quot;
	for i=len(stext) to 1 step -1
		if mid(stext,i,1)<>&quot; &quot; then 
			s=s+mid(stext,i,1)
		else 
			i=-1
		end if
	next
	 getLastNum=s
end function
while not file.AtEndOfStream
    sline=file.ReadLine
	if sline<>&quot;                                                                    &quot;  AND sline<>&quot;&quot; then
		if instr(1,sline,&quot;PLAY DATE:&quot;)=0 then
				stime=left(sline,size1)
				sline=replace(sline,stime,&quot;&quot;)
				
				stype=left(sline,size2)
				sline=replace(sline,stype,&quot;&quot;)
				
				snumber=&quot;&quot;
				snumber=CStr(getNum(sline))
				sline=replace(sline,snumber,&quot;&quot;)
				
				slastnumber=getLastNum(sline)
				sline=replace(sline,slastnumber,&quot;&quot;)

				stitle=left(sline,size3)
				sprod=replace(sline,stitle,&quot;&quot;)

				if snumber<>&quot;1.#QNAN&quot; then
		%>
		<tr>
			<td><font size=2><%=stime%></font>
			</td>
			<td><font size=2><%=stype%></font>
			</td>
			<td><font size=2><%=snumber%></font>
			</td>
			<td><font size=2><%=stitle%></font>
			</td>
			<td><font size=2><pre><%=sprod%></pre></font>
			</td>
			<td><font size=2><pre><%=slastnumber%></pre></font>
			</td>
		</tr>
		<%
			end if
		else
		%>
		<tr>
			<td colspan=6><font size=3><b><%=sline%></b></font>
			</td>
		</tr>
		<%
		end if
end if
wend
%>
</table>
<script language=javascript runat=&quot;server&quot;>
function getNum(str)
{
	return parseInt(str)
}
</script>

And now a litle explanation of important code here, the rest you would figure out :p

1.if you decoment this line Response.ContentType=&quot;application/vnd.ms-excel&quot;
the output should be excel file
2.getLastNum(stext) gets the last number from the line
3.this line replace(var1,var2,&quot;&quot;) gets over the corect text we found that time, easyer then using left and mid function.
4. this function &quot;getNum(sline)&quot; might be a bit strange but belive me it hels a lot more then you imagine.
I'm using VBScript and Javascrip in same page just for getting advantage of he parseInt javascript function.
This function gets any string and returns the number even from the lines like &quot;23742some text here&quot;, easyer then making my own function:p

Anyway this worked for the example file verry well the rest you'll figure out, post back if this works or need more assistance ________
George, M
 
I spoke to the developer @ Music Librarian and they are pretty
much unwilling to change the exporting functionality. They're looking &quot;into&quot; it - but I'm not keeping my finger crossed.

So, I have done the following.
Parsed the whatever-delimited txt file this way thanks to George's reply. THANKS!
==============================================
<%

DIM databaseMonths(12)
databaseMonths(0) = &quot;jan&quot;
databaseMonths(1) = &quot;feb&quot;
databaseMonths(2) = &quot;mar&quot;
databaseMonths(3) = &quot;apr&quot;
databaseMonths(4) = &quot;may&quot;
databaseMonths(5) = &quot;jun&quot;
databaseMonths(6) = &quot;jul&quot;
databaseMonths(7) = &quot;aug&quot;
databaseMonths(8) = &quot;sep&quot;
databaseMonths(9) = &quot;oct&quot;
databaseMonths(10) = &quot;nov&quot;
databaseMonths(11) = &quot;dec&quot;

databaseYear = MID(REQUEST(&quot;yr&quot;),3,2)
'---SET VARIABLES AND OPEN DATA FILE
dim thepath
thepath = server.mappath(&quot;/cms/FileLib/&quot;) & &quot;\&quot;
Response.ContentType=&quot;application/vnd.ms-excel&quot;
set fso=Server.CreateObject(&quot;Scripting.FileSystemObject&quot;)
'SET playlistObject = Server.CreateObject(&quot;Scripting.FileSystemObject&quot;)
set file=fso_OpenTextFile(thepath & databaseMonths(REQUEST(&quot;mo&quot;)-1) & databaseYear & &quot;.txt&quot;)
'set file=fso_OpenTextFile(&quot;D:\Inetpub\'SET playlist = playlistObject.OpenTextFile(thepath & databaseMonths(REQUEST(&quot;mo&quot;)-1) & databaseYear & &quot;.txt&quot;)

size1=len(&quot; 12:00 AM &quot;)
size2=len(&quot;PROGRAM &quot;)
size3=len(&quot;Parisian Quartet No. 10 (Nouveau No. 4)&quot;)
%>
<table border=1 CELLPADDING=&quot;1&quot; CELLSPACING=&quot;1&quot; BORDERCOLOR=&quot;#FFFFFF&quot; BGCOLOR=&quot;#CCCCCC&quot;>
<%
function getLastNum(stext)
s=&quot;&quot;
for i=len(stext) to 1 step -1
if mid(stext,i,1)<>&quot; &quot; then
s=s+mid(stext,i,1)
else
i=-1
end if
next
getLastNum=s
end function
while not file.AtEndOfStream
sline=file.ReadLine
if sline<>&quot; &quot; AND sline<>&quot;&quot; then
if instr(1,sline,&quot;PLAY DATE:&quot;)=0 then
stime=left(sline,size1)
sline=replace(sline,stime,&quot;&quot;)

stype=left(sline,size2)
sline=replace(sline,stype,&quot;&quot;)

snumber=&quot;&quot;
snumber=CStr(getNum(sline))
sline=replace(sline,snumber,&quot;&quot;)

slastnumber=getLastNum(sline)
sline=replace(sline,slastnumber,&quot;&quot;)

stitle=left(sline,size3)
sprod=replace(sline,stitle,&quot;&quot;)

if snumber<>&quot;1.#QNAN&quot; then
%>
<tr BORDERCOLOR=&quot;#FFFFFF&quot;>
<td><font size=2><%=stime%></font>
</td>
<td><font size=2><%=stype%></font>
</td>
<td><font size=2><%=snumber%></font>
</td>
<td><font size=2><%=stitle%></font>
</td>
<td><font size=2><pre><%=sprod%></pre></font>
</td>
<td><font size=2><pre><%=slastnumber%></pre></font>
</td>
</tr>
<%
end if
else
%>
<tr>
<td colspan=6 BORDERCOLOR=&quot;#FFFFFF&quot;><font size=3><b><%=sline%></b></font>
</td>
</tr>
<%
end if
end if
wend
%>
</table>
<script language=javascript runat=&quot;server&quot;>
function getNum(str)
{
return parseInt(str)
}
</script>
<%
rsPLAYlist.Close()
Set rsPLAYlist = Nothing
%>
=============================================

This creates a excel wrkbok that I can manage to export a tab-delimited file into Access then use my limited experience in, <embarrassed> MM Dreamweaver to display the recordset by three session variables:
1) current time
2) current month
3) current year
I hate to go the well on this thread, but do you know how I could merge two Access tables by one criteria/variable? I'm mean, I have one table that contains the station programming information, and then I have this playlist file residing in another table. Is it possible to have a faction build the program info in the table header then strip in the playlist info accordingly?
For I would like to have the user to see what playing by those three criteria - this was gleaned from a survey.
More importantly - I would like to have the front page display the current composition, real-time, via a timer that queries the db for the current:
1) composition title
2) composer
3) program title/description
4) announcer bio

I have bitten off WAY more than I can chew. I would greatly appreciate any help you could offer.
 
Well it seems that you can merge the two databases witch probably contains one table each into one database with two tables.
I dont think if this is what you mean but if you can make a description of the 2 databases and what fields are related between them it will help.

________
George, M
 
Hey thanks,
I have one Access db for the site; within the db are two tables. One table contains the station’s programming info. The other is the one table created by the imported playlist txt file. The programming table has fields, which are defined by the days of the week for the entire month. For example:
ID DayOfWeek StartTime EndTime ProgramTitle
1 Sun 12:00 am 6:00 am A Lot of Night Music
The second table is the one created by the imported txt file. The site, in it inception, had the following legacy code:
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
<%



DIM databaseMonths(12)
databaseMonths(0) = &quot;jan&quot;
databaseMonths(1) = &quot;feb&quot;
databaseMonths(2) = &quot;mar&quot;
databaseMonths(3) = &quot;apr&quot;
databaseMonths(4) = &quot;may&quot;
databaseMonths(5) = &quot;jun&quot;
databaseMonths(6) = &quot;jul&quot;
databaseMonths(7) = &quot;aug&quot;
databaseMonths(8) = &quot;sep&quot;
databaseMonths(9) = &quot;oct&quot;
databaseMonths(10) = &quot;nov&quot;
databaseMonths(11) = &quot;dec&quot;

databaseYear = MID(REQUEST(&quot;yr&quot;),3,2)

'------------------ NOTE ---------------------'
' '
' UNCOMMENT (-AND COMMENT OUT-) THE '
' APPROPRIATE PATH INFO &quot;BEFORE&quot; UPLOADING '
' TO FREESIDE OR EDITING ON BOGART IN '
' '
' &quot;SET VARIABLES AND OPEN DATA FILE&quot; BELOW '
' '
'-----------------------------------------------'


'---SET VARIABLES AND OPEN DATA FILE
dim thepath
thepath = server.mappath(&quot;/cms/FileLib/&quot;) & &quot;\&quot;

SET playlistObject = Server.CreateObject(&quot;Scripting.FileSystemObject&quot;)
SET playlistCount = playlistObject.OpenTextFile(thepath & databaseMonths(REQUEST(&quot;mo&quot;)-1) & databaseYear & &quot;.txt&quot;)

'SET playlistCount = playlistObject.OpenTextFile(&quot;\\Grace\web\kmfa01\playlists\&quot; & databaseMonths(REQUEST(&quot;mo&quot;)-1) & databaseYear & &quot;.txt&quot;)
SET playlist = playlistObject.OpenTextFile(thepath & databaseMonths(REQUEST(&quot;mo&quot;)-1) & databaseYear & &quot;.txt&quot;)
'SET playlist = playlistObject.OpenTextFile(&quot;\\Grace\web\kmfa01\playlists\&quot; & databaseMonths(REQUEST(&quot;mo&quot;)-1) & databaseYear & &quot;.txt&quot;)


if nomonth = &quot;&quot; then

i=0
p=0
bgc=&quot;#dddddd&quot;

'---GET LINE COUNT
WHILE NOT playlistCount.AtEndOfStream
x=playlistCount.ReadLine
if x=&quot;nodata&quot; then
absent=true
end if
p=p+1
WEND

'---SET PLAYLIST ARRAY TO CORRECT COUNT
DIM playlistArray()
REDIM playlistArray(p)

'---PARSE PLAY LIST LINE BY LINE
WHILE NOT playlist.AtEndOfStream
playlistArray(i)=(playlist.ReadLine)
i=i+1
WEND

playlist.CLOSE

'---THE FUNCTIONS
FUNCTION dateHeader(theDate)
RESPONSE.WRITE(&quot;<table width='100%' border='0' cellpadding=0 cellspacing=1><tr><td bgcolor='#000000'>&quot;)
RESPONSE.WRITE(&quot;<font face='Arial, Helvetica' size='-1' color='#000000'><b>.</b></font>&quot;)
RESPONSE.WRITE(&quot;<font face='Arial, Helvetica' size='-1' color='#ffffff'><b>&quot; & theDate & &quot;</b></font>&quot;)
RESPONSE.WRITE(&quot;</td></tr></table>&quot;)
END FUNCTION



FUNCTION ditties(theTime,theComposer,thePiece,theSong,theLabel,theSpine)
IF bgc=&quot;#eeeeee&quot; THEN
bgc=&quot;#dddddd&quot;
ELSE
bgc=&quot;#eeeeee&quot;
END IF
amSearch=&quot;javascript:amazonCheck('&quot; & TRIM(theSong) & &quot;','&quot; & TRIM(theComposer) & &quot;','','')&quot;
limitedSearch=&quot;javascript:amazonCheck('','','','&quot; & TRIM(theSpine) &&quot;')&quot;
' snagTableHeader(theTime)
RESPONSE.WRITE(&quot;<tr>&quot;)
RESPONSE.WRITE(&quot;<td valign='top' bgcolor='&quot; & bgc & &quot;' width='50'>&quot;)
RESPONSE.WRITE(&quot;<font face='Arial, Helvetica' size='-2'>&quot; & theTime & &quot;</font></td>&quot;)
RESPONSE.WRITE(&quot;<td valign='top' bgcolor='&quot; & bgc & &quot;'><table border=0 width='100%'cellspacing=0 cellpadding=0><tr><td valign='top' width='35%'>&quot;)
RESPONSE.WRITE(&quot;<font face='Arial, Helvetica' color='#333333' size='-1'><b>&quot; & theComposer & &quot;</b></font></td>&quot;)
' RESPONSE.WRITE(&quot;<td valign='top' bgcolor='&quot; & bgc & &quot;'>&quot;)
' RESPONSE.WRITE(&quot;<font face='Arial, Helvetica' size='-1'>&quot; & thePiece & &quot;</font>&quot;)
' RESPONSE.WRITE(&quot;<td valign='top' bgcolor='&quot; & bgc & &quot;'>&quot;)
RESPONSE.WRITE(&quot;<td width='65%' valign='top'><font face='Arial, Helvetica' size='-1'>&quot; & theSong & &quot;</font></td></tr></table>&quot;)
' RESPONSE.WRITE(&quot;<td colspan=2 valign='top' bgcolor='&quot; & bgc & &quot;'>&quot;)
RESPONSE.WRITE(&quot;<font face='Arial, Helvetica' size='-1'><b>Label:</b> &quot; & theLabel & &quot; </font>&quot;)
'RESPONSE.WRITE(&quot;<td valign='top' bgcolor='&quot; & bgc & &quot;'>&quot;)
RESPONSE.WRITE(&quot;        &quot;)
RESPONSE.WRITE(&quot;<font face='Arial, Helvetica' size='-1'><b>Spine Number:</b> &quot; & theSpine & &quot;</font>&quot;)
' amazon links
'RESPONSE.WRITE(&quot;<br><font face='Arial, Helvetica' size='-2'>Search Amazon.com by <a href=&quot; & CHR(034) & amSearch & CHR(034) & &quot;><img src='../images/artistandpiece.gif' border=0 align='absmiddle'></a> or by <a href=&quot; & CHR(034) & limitedSearch & CHR(034) & &quot;><img src='../images/performance.gif' border=0 align='absmiddle'></a></font></td>&quot;)
RESPONSE.WRITE(&quot;<br><font face='Arial, Helvetica' size='-2'>Amazon links temporarily unavailable. <b>Use the Amazon search above</b></font></td>&quot;)
RESPONSE.WRITE(&quot;</tr>&quot;)
END FUNCTION

'---STRIP CHARS
numbers=&quot;0123456789&quot;
LastNum=0
ThisNum=0
NextNum=0
FUNCTION timeStripper(xxx)
TempNum=&quot;&quot;
FOR s=1 TO LEN(xxx)
IF InStr(numbers,MID(xxx,s,1))>0 THEN
TempNum=TempNum & MID(xxx,s,1)
END IF
NEXT
IF InStr(xxx,&quot;PM&quot;)>0 AND NOT InStr(xxx,&quot;12:&quot;)>0 THEN
TempNum=TempNum+1200
END IF
timeStripper=TempNum
END FUNCTION

'---SET PROGRAM TITLES ARRAY
FUNCTION snagTableHeader(programTime)
NextNum=timeStripper(timeStripper(programTime))
FOR pTime=0 TO UBOUND(programHeaderTable)
ThisNum=timeStripper(timeStripper(programHeaderTable(pTime,1)))
IF ThisNum<=NextNum AND ThisNum>LastNum THEN
Response.Write(programHeaderTable(pTime,0))
END IF
NEXT
LastNum=NextNum
NextNum=&quot;&quot;
END FUNCTION

'---GET REQUESTED DATE FROM QUERY
BEGIN=REQUEST(&quot;dy&quot;) & &quot;, &quot; & REQUEST(&quot;mo&quot;) & &quot;/&quot; & REQUEST(&quot;dt&quot;) & &quot;/&quot; & REQUEST(&quot;yr&quot;)
WRITING=FALSE



'---SNAG THE HEADERS
'SET schedule=Server.CreateObject(&quot;ADODB.Connection&quot;)
'schedule.Open &quot;schedule&quot;

'pullTable=&quot; SELECT * FROM &quot; & REQUEST(&quot;mo&quot;) & REQUEST(&quot;yr&quot;) & &quot; &quot;
'Set addRows=schedule.Execute(pullTable)
'Set pt=schedule.Execute(pullTable)

'rows=0
'r=0
'WHILE NOT addRows.EOF
' IF addRows(&quot;DayOfWeek&quot;)=REQUEST(&quot;dy&quot;) THEN
' rows=rows+1
' END IF
' addRows.MoveNext
'WEND

'DIM programHeaderTable()
'REDIM programHeaderTable(rows,1)
'a=0
'WHILE NOT pt.EOF
' IF pt(&quot;DayOfWeek&quot;)=REQUEST(&quot;dy&quot;) THEN
' programHeaderTable(r,0)=&quot;<tr><td colspan=2 bgcolor='#888888' valign='top' align='left'><font face='Arial, Helvetica' size='2' color='#ffffff'><b>&quot; & pt(&quot;ProgramDescription&quot;) & &quot; </b><font size='-2'>&quot; &(pt(&quot;StartTime&quot;) & &quot; - &quot; & pt(&quot;EndTime&quot;) & &quot;</font></font></td></tr>&quot;)
' programHeaderTable(r,1)=pt(&quot;StartTime&quot;)
' r=r+1
' END IF
' pt.MoveNext
'WEND


'---ADD IN THE HEADER
dateHeader(BEGIN)

if absent = true then
response.write(&quot;<br><br>    Sorry, no data available for Current Month <br><br>&quot;)
end if


'---ROLL THROUGH THE playlistArray PARSING THE STRINGS
qLength=0
goAhead=&quot;false&quot;


IF REQUEST(&quot;dt&quot;)=&quot;01&quot; THEN
goAhead=&quot;true&quot;
END IF

'FOR pHT=0 TO rows-1
' RESPONSE.WRITE(programHeaderTable(pHT,0))
' IF pHT<rows-1 THEN
' LastCheck=timeStripper(programHeaderTable(pHT+1,1))
' ELSE
' LastCheck=2401
' END IF

if REQUEST(&quot;yr&quot;)=&quot;2000&quot; and REQUEST(&quot;mo&quot;)<>&quot;12&quot; then

FOR q=qLength to UBOUND(playlistArray)
IF WRITING=TRUE AND LEN(TRIM(playlistArray(q)))>0 THEN
playTime=MID(playlistArray(q),1,9)
Composer=MID(playlistArray(q),10,32)
Piece=&quot;&quot;
FOR s=42 TO LEN(playlistArray(q))-43
qq=MID(playlistArray(q),s,1)
IF qq=&quot;0&quot; OR qq=&quot;1&quot; OR qq=&quot;2&quot; OR qq=&quot;3&quot; OR qq=&quot;4&quot; OR qq=&quot;5&quot; OR qq=&quot;6&quot; OR qq=&quot;7&quot; OR qq=&quot;8&quot; OR qq=&quot;9&quot; THEN
Piece=Piece & MID(playlistArray(q),s,1)
ELSE
EXIT FOR
END IF
NEXT
Song=MID(playlistArray(q),42+LEN(Piece),40)
Label=MID(playlistArray(q),82+LEN(Piece),11)
Spine=MID(playlistArray(q),93+LEN(Piece),LEN(playlistArray(q))-92-LEN(Piece))
' a=timeStripper(playTime)*1
' b=timeStripper(programHeaderTable(pHT,1))*1
' c=LastCheck*1
' IF a>=b AND a<c THEN
qLength=qLength+1
z=ditties(playTime,Composer,Piece,Song,Label,Spine)
' ELSE
' EXIT FOR
' END IF

END IF

IF &quot;PLAY DATE: &quot;&BEGIN=TRIM(playlistArray(q)) OR goAhead=&quot;true&quot; THEN

goAhead=&quot;false&quot;
WRITING=TRUE
RESPONSE.WRITE(&quot;<table width='100%' border='0' cellspacing=1 cellpadding=0>&quot;)
END IF
IF WRITING=TRUE AND LEN(TRIM(playlistArray(q)))=0 THEN
RESPONSE.WRITE(&quot;</table>&quot;)
EXIT FOR
END IF
NEXT
else

FOR q=qLength to UBOUND(playlistArray)
IF WRITING=TRUE AND LEN(TRIM(playlistArray(q)))>0 THEN
playTime=MID(playlistArray(q),6,9)
Composer=MID(playlistArray(q),16,32)
Piece=&quot;&quot;
FOR s=48 TO LEN(playlistArray(q))-49
qq=MID(playlistArray(q),s,1)
IF qq=&quot;0&quot; OR qq=&quot;1&quot; OR qq=&quot;2&quot; OR qq=&quot;3&quot; OR qq=&quot;4&quot; OR qq=&quot;5&quot; OR qq=&quot;6&quot; OR qq=&quot;7&quot; OR qq=&quot;8&quot; OR qq=&quot;9&quot; THEN
Piece=Piece & MID(playlistArray(q),s,1)
ELSE
EXIT FOR
END IF
NEXT
Song=MID(playlistArray(q),48+LEN(Piece),40)
Label=MID(playlistArray(q),88+LEN(Piece),11)
Spine=MID(playlistArray(q),99+LEN(Piece),LEN(playlistArray(q))-98-LEN(Piece))
' a=timeStripper(playTime)*1
' b=timeStripper(programHeaderTable(pHT,1))*1
' c=LastCheck*1
' IF a>=b AND a<c THEN
qLength=qLength+1
z=ditties(playTime,Composer,Piece,Song,Label,Spine)
' ELSE
' EXIT FOR
' END IF

END IF
'OR goAhead=&quot;true&quot;
IF &quot;PLAY DATE: &quot;&BEGIN=TRIM(playlistArray(q)) THEN

goAhead=&quot;false&quot;
WRITING=TRUE
RESPONSE.WRITE(&quot;<table width='100%' border='0' cellspacing=1 cellpadding=0>&quot;)
END IF
IF WRITING=TRUE AND LEN(TRIM(playlistArray(q)))=0 THEN

RESPONSE.WRITE(&quot;</table>&quot;)
EXIT FOR
END IF
NEXT
end if

'NEXT

'schedule.Close
else

response.write(nomonth)

end if
%>
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
I have tried to get this code restored to its former functionality. No luck much has been changes by years of neglect and many chiefs in the kitchen. I think the code originally, displayed the playlist according to the day and month sent as requested variables from the calendar on the preceding page. The scripts then would build the header tables with the corresponding programming information based on the requested information. Then the table would fill out by being sorted by time.
I think.
Since I know very little about VBScript I thought it would be more manageable for my to use Access dbs within ASP pages and use the OOP in Dreamweaver to design/build the site. One quick question – the script you sent, inverts the lastNum to read backwards.
For example:
6:50 AM Johann (Jan Jiri) Benda 6862 Violin Concerto Naxos 553902 209355
The 553902 sequences is correct and I would need to trim off that number to not show in the same cell as the CD lable, in this case 553902 would not be displayed next to Naxos, just in the last cell.
Thanks so very much George!
-Cal
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top