Caiapfas
asked on
Make a listing option while making the webpages
ok, I want to edit this javascript and add a new Var/function. I'm going to create a perl script that looks at the htm files made from this javascript and finds on the very first line <!--_STATE__--> and automaticly adds a link to the page on the main section, for this case Venues. So what I want to do when I initiate the script I would like it to prompt me to ( Do you want to add the (Y)States or the (N)First Letter for the Artist/Venues?) so it would change the output of _STATE_, reason I'm using this script for making artist/events. And the new PERL program will either input a link to the venue under the right section(State) or a link to the artist page under the right letter. SAVING ME HOURS!!!!
I know there are better scripts/ways, but for this case i'm working with legancy. I do plan to move to asp.net, but the need it now. not when I learn asp.net.
Thank you,
Caiapfas
var template = "C:\\aa\\venuetemplate.htm ";
var list = "C:\\aa\\venues2.csv";
var dstFolder = "C:\\aa\\venues\\";
var fso =new ActiveXObject("Scripting.F ileSystemO bject");
//read template
var templFile = fso.OpenTextFile(template, 1);
var templText = templFile.ReadAll();
templFile.close();
WScript.StdOut.WriteLine(" Template length is: " + templText.length);
//process venue list
var listFile = fso.OpenTextFile(list, 1);
var head=listFile.ReadLine(); //skip header
WScript.StdOut.WriteLine(" Header line: " + head);
while(!listFile.AtEndOfStr eam) {
var line=listFile.ReadLine();
WScript.StdOut.WriteLine(" processing line: " + line);
var fields=line.split(","); // Comma Delimited
//var fields=line.split("\t"); // Tabs
WScript.StdOut.WriteLine(" fields#: " + fields.length);
try {
var VenueID=fields[0];
WScript.StdOut.WriteLine(" venue id: " + fields[0]);
var VenueName=fields[1];
WScript.StdOut.WriteLine(" venue name: " + fields[1]);
var VenueState=fields[2];
WScript.StdOut.WriteLine(" venue name: " + fields[1]);
var fname=VenueName.toLowerCas e().replac e(/ /g, "_") + ".htm";
WScript.StdOut.WriteLine(" output filename: " + fname);
var dstFileFullname=fso.BuildP ath(dstFol der, fname);
WScript.StdOut.WriteLine(" dest filename: " + dstFileFullname);
var dstFile = fso.CreateTextFile(dstFile Fullname, true);
dstFile.write(templText.re place(/_VE NUE_NAME_/ g, VenueName).replace(/_VENUE _ID_/g, VenueID).replace(/_STATE_/ g, VenueState));
dstFile.close();
}
catch(e) {
WScript.echo("Error processing venue id " + VenueID + " with name '" + VenueName + "'");
}
}
listFile.close();
I know there are better scripts/ways, but for this case i'm working with legancy. I do plan to move to asp.net, but the need it now. not when I learn asp.net.
Thank you,
Caiapfas
var template = "C:\\aa\\venuetemplate.htm
var list = "C:\\aa\\venues2.csv";
var dstFolder = "C:\\aa\\venues\\";
var fso =new ActiveXObject("Scripting.F
//read template
var templFile = fso.OpenTextFile(template,
var templText = templFile.ReadAll();
templFile.close();
WScript.StdOut.WriteLine("
//process venue list
var listFile = fso.OpenTextFile(list, 1);
var head=listFile.ReadLine(); //skip header
WScript.StdOut.WriteLine("
while(!listFile.AtEndOfStr
var line=listFile.ReadLine();
WScript.StdOut.WriteLine("
var fields=line.split(","); // Comma Delimited
//var fields=line.split("\t"); // Tabs
WScript.StdOut.WriteLine("
try {
var VenueID=fields[0];
WScript.StdOut.WriteLine("
var VenueName=fields[1];
WScript.StdOut.WriteLine("
var VenueState=fields[2];
WScript.StdOut.WriteLine("
var fname=VenueName.toLowerCas
WScript.StdOut.WriteLine("
var dstFileFullname=fso.BuildP
WScript.StdOut.WriteLine("
var dstFile = fso.CreateTextFile(dstFile
dstFile.write(templText.re
dstFile.close();
}
catch(e) {
WScript.echo("Error processing venue id " + VenueID + " with name '" + VenueName + "'");
}
}
listFile.close();
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thank you,
you hit it right on the head, a quick side question...is this just javascript? cause I see things i dont recongnize..
you hit it right on the head, a quick side question...is this just javascript? cause I see things i dont recongnize..
Javascript and Windows Scripting Host
ASKER
cool, I'm learning perl right now, but I seem to be trying to much at once, altought the results are rolling in, now I have the means to make thousands of custom pages but I need a way to add them the a main section(page). I don't think javascript can do this, so I tried my infant perl skills, ouch would ya mind taking a look?
https://www.experts-exchange.com/questions/20935310/help-Making-a-automatic-link-maker.html
after this I'm on easy street just need to read, read, read and soon asp.net adventures begin..
https://www.experts-exchange.com/questions/20935310/help-Making-a-automatic-link-maker.html
after this I'm on easy street just need to read, read, read and soon asp.net adventures begin..
ASKER
lbertacco,
Do you think I could get you email address, mine it support@cdatasolutions.com << you can email if you want to keep it off EE..I want to add you to the
// Version 1.3 - PageBuilder
// Script Design by lbertacco
before I hand it over to my friend and I wouldnt mind having it..=}
Do you think I could get you email address, mine it support@cdatasolutions.com
// Version 1.3 - PageBuilder
// Script Design by lbertacco
before I hand it over to my friend and I wouldnt mind having it..=}
ASKER