Posts Tagged ‘ perl ’

Renaming Files Using Perl

June 16, 2009
By Killian

I finally got around to writing a script to rename all my music files to the same convention. That being either <track>-<song>.mp3 or <song>.mp3 with no spaces (I prefer underscores instead) and all lowercase. I know, it looks so simple! But the problem is all those occasions where you have something like <track>_-_<SONG>_-_(<remix by>).mp3...
Read more »

Tags: , , , ,
Posted in perl | No Comments »

Renaming Files As Lowercase Using Perl

November 12, 2008
By Killian

This is just a handy script I use for renaming my music collection. It got to be too much trouble having the first letter of each word capitalised, getting new music with the names all in caps, or all in lowercase…so I decided to make everything lowercase and write a script to do it...
Read more »

Tags: , , , ,
Posted in perl | No Comments »

CsvSQL Man Page

November 12, 2008
By Killian

NAME Csvsql – use SQL queries to access information in CSV files DESCRIPTION csvsql enables you to access a CSV file as if it were a table in a database. This means you can use SQL queries, with each ’common seperated value’ as part of a column. Traditionally in order to access specific information...
Read more »

Tags: , , , ,
Posted in csvsql | No Comments »

CsvSQL

November 12, 2008
By Killian

About CsvSQL Csvsql is a project I started for my BSc’s final year software project. It is written in Perl and can be used to access information in csv files in the same way you would access a table in a database. This means you can use SQL queries, with each common seperated value...
Read more »

Tags: , , ,
Posted in csvsql | No Comments »

Printing In Perl

November 12, 2008
By Killian

Printing A String Printing a string in Perl couldn’t be easier, you simply use the print function. If you want to print a line in Perl you simple need to write the following: print "Hello World!"; Output: Hello World! Similarly you you print a variable as follows: my $string = "Hello World!"; print $string;...
Read more »

Tags: , , , ,
Posted in perl | No Comments »

Reading From A File In Perl

November 12, 2008
By Killian

Opening a file eading from a file in Perl is pretty simple. After all, the language is pretty much built around dealing with text. The first step is to open the file, in which case you just need to use the following: open(INFILE,"< myfile.txt") or die "Can't open file: $!"; In this statement we...
Read more »

Tags: , ,
Posted in perl | No Comments »

Perl Loop Basics

November 12, 2008
By Killian

For loop The below will print “Hello!” 10 times: for ($i = 0; $i &lt; 10 ; $i++){ print "Hello!\n"; } Output: Hello! Foreach loop For iterating through an array it can be handy to use a foreach loop. In the example below the foreach loop will access each variables in the array and...
Read more »

Tags: , , , ,
Posted in perl | No Comments »

Perl Array Basics

November 12, 2008
By Killian

Initialising or clearing an array To create a new array it is as simple as declaring it as shown below. This method can also be used to clear an existing array, though you will have to drop the my. my @array = (); Creating an array with predefined elements To create a new array...
Read more »

Tags: , ,
Posted in perl | No Comments »

Calendar

    September 2010
    M T W T F S S
    « Jun    
     12345
    6789101112
    13141516171819
    20212223242526
    27282930