Write
-
- Generating Long Lists of Links to Files in pMachine
-
This might be an esoteric tip, but I’ll throw it out there anyway. For a project I’m working on, I needed some pMachine entries with long lists of links to files - hundreds, in some cases. Faced with the prospect of creating each link on a one by one basis I went looking for a better way. Since I used to be known as “Access Mike” at a previous job, I looked for a way to build the list in MSAccess.
First thing, though, was to use an FTP program to upload the target files in bulk to the website, rather than using pMachines file upload interface. No-brainer there.
Next was to work on creating the quasi-HTML needed to create the links in a pMachine entry. What I needed was a text file with the list of filenames to link to. I’ve never been much of a command-prompt guru, but I found this tip to be exactly what I needed.
Now we can take that list of file names and cut/paste it into MSAccess as a table. Cool - now I’m right at home…name the new field in this new table “filename”. Close and save the table.
Next up is a Query where we can massage the straight filename into the link code that pMachine generates.
Here’s what pMachine builds when you use the built in upload/link tool (note that I’ve left off the leading wickets on the link tags so that pMachine won’t interpret the link):
a href=“http://boyink.com/images/blog/FileNameHere.doc” >LinkTextHere /a>
Our goal is to have Access generate that text for every record in the new table.
In the Access query, bring in the table you created, then create a new calculated field with the following formula (again you’ll have to add the leading wickets on the open and close of the link tag):
Linktext: “a href=” & ‘“’ & “http://boyink.com/images/blog/” & [filename] & ‘“’ & “>” & [filename] & “/a>”
Note that were you want double quotes in the output you have to enclose them in single quotes.
Save the query, and go back to the database window. Select the query and choose “Export”. Choose a txt file, and name it. Now choose “delimted”, and “None” for a Text Qualifier. Perform the export.
Now go find the file, and open it. You should have the pMachine code for every file in the directory you started with. Copy it to the clipboard, and then paste it into a pMachine entry.
Now go punch your Geek card…;)
If you have different file types and want to group the links together, create another calculated field in the Access query, and do a Right$([filename],3) as a formula. Choose sort, acending on the field and then turn off it’s visibility. You’ll also now need to bring down the [filename] field again and sort it ascending to sort the links alphabetically within file type groups.
-
- The Big Web Design Details List
-
I decided to make, or rather — start — a list of questions you may want to ask yourself when designing, building and/or maintaining a Web site. Full Post >>
-
- Top 10 Usability Blunders of the Big Players
-
In March 2003, Philippe Randour pointed out the Top 7 Usability Blunders Of The Big Players here on SitePoint. Since then, Web usability practices have become even more commonplace, and knowledge of the many Web usability benefits has become more widespread. The big players must surely have improved since then, right? Let’s find out… Full Article >>
-
- AmericanSeating.com Relaunches
-
For over 100 years American Seating has set the standard for product design, durability and comfort. Our record of past achievements serves as the platform for the design of innovative seating products which continues to be the benchmark of our industry. View the Site >>
-
- ParentPager.com Relaunches
-
Parent Pager - Child Security. Parent and Staff Communications. Record Keeping. http://www.parentpager.com/