These scripts come as they are. They work pretty well in my opinion,
but then again I know how they work. You could conceivably come up
with some crazy input that could cause problems but I think they are
pretty solid. These are mostly for use in Unix systems (or at least
that's where I use them). You might need to change the first line to
match wherever you happen to have Perl installed. I have over 300
(and growing) Perl scripts (some just hacks of others) to do one thing
or another. Here are a few that I think someone else in the world
might find useful. Of course, that person probably won't find this
page.
- changeextension.prl
- changes the extensions of file names
When I'm generating a bunch o' data, I usually end up disliking
the extensions I used. Or some times, I end up generating more
data and want to distinguish the new from the old. This script
changes the extension of all of the files in the current
directory whose extension matches whatever you give it. In
particular, you enter what the extension is that you want to
change and what you want to change it to and it happens. I've
never had a problem with this, but you might want to create a copy
of the files in a temporary folder.
- changeintension.prl
- changes the beginning of file names
Some times you need to change the starting part of the filename (or
at least I do) for a bunch of files. So I called that, for lack
of a better idea, the intension. This is similar to above but only
changes the beginning of the file names.
- linkify.prl
- creates web links within an html file
Web pages are hard to keep updated, at least for me. It always
seems like the web addresses are changing, people are moving,
etc., and it is really a pain to hunt these things down in the
html file. So I wrote a script to create my web cv (and also a
LaTeX version). Actually, I do the same for my preprints page.
If you want these scripts, let me know. They are going to be a
little harder to configure (I'm guessing an hour-ish) but once
you get them up and running, you will have a lifetime of bliss
(as long as you don't mind the layout of these pages on my
website). Anyway, as I was writing those scripts, I was trying
to figure out how to deal with linking to web pages that are
always on the move. I decided the best way is to have those
scripts create flat html (without weblinks) and then use a
script to update the links. Then when anything changes, I just
update a text file containing all of the web site information,
rerun the scripts, and life is good again. So that's the long
story. The shorter story is you have to create a file called
websites.txt (that's the one used to make this page). On each
line, you write the phrase that you want to get hyperlinked,
followed by a semicolon, followed by the full web address of
what you want it linked to. This is extremely sensitive to
spaces, so only put them where you want them (in particular,
don't put them around the semicolon). It's also case
sensitive. Also, also, you can run into troubles if you double
use a phrase. For example, I had NSF and NSF Grant in one and
that created a double link sort of thing that you probably
don't want. Actually, the gaudy web linking on this page came
from using good old linkify on perl.txt to get the hyperlinked
html that you see right in front of you. You need to input the
name of the file to linkify (in this case, perl.txt) and the
name of the output file (perl.html).
- csvtolatextable.prl
- creates a latex table from a csv file
Invariably, I end up with spreadsheet files I need to turn into
LaTeX tables for papers I'm writing. I simply don't trust my
patience and mouse maneuvering ability enough to copy
everything correctly. Plus, I have this self-imposed rule, if
I have to do it more than once, I write a script to do it.
Oftentimes there is a lot of overhead in doing so but the
payoff is big over time (and I always learn something along the
way, which is nice). This takes a comma-delimited spreadsheet
file and creates a LaTeX table. The first line of the csv file
is used as the header. This creates a crude table and you
might need to hack it to make it look the way you want it to
look but it beats typing the ampersand a billion times.
- csvtohtml.prl
- creates an html table from a csv file
This is similar to above except that it kicks out a html table.
This will save you from having to type <td> and </td>
a billion times.