Perl - Shell Scripts

The usefulness of perl is not very much exploited by windows users. I wish I could change that by my scripts. For these scripts to work, get ActivePerl if you are a Windows user. If you use perl, just run these scripts at the console with the command 'perl <filename>'. All the given scripts are free for you to copy, distribute, modify or any other thing that comes to your mind.

These scripts that I have provided here are made by me and used with the Active Perl compiler. I made the first two to aid me in organizing many html files. They may not be much help for you as it is, but you can use them after modifications.

SeekAndExtract Vs 1.00.B
For extracting content from HTML files from a user specified string to another user specifed string and save them as a txt file. Useful if you have a lot of html files you need to convert to text files.
LineRename V 1.00.A
Renames all the text files in a folder to their respective first lines. If there are blank lines, it clears the file of all blank lines. I don't see how you can use this program to fit your perpose, but I made it when I had a lot of small poems in text files. I used this program to give the poem's files names.
HTMLViewer V 1.02.A
This is a offline HTML file viewer for DOS. Run the script with the html file in the command line. For best results, use the Batch file 'html.bat
 



I have made more Shell Scripts, but I don't know whether the visitors of this web can use it. As a result, I have not uploaded it. All my scripts are listed here - just the name and a small description, no script. If any one is intrested in any script, please let me know and I will upload the specified program.

record analyser1.00.A
This script analyses the 'Record.txt' file made by the Boot Boster program and show the results in a graphical format. This script will give you a graphical break down of all your boots. It compare the hits in Morning and Evening, in the different hours of the day, and in all the months. It will display the results in a very detailed and attractive graphical form.
DigitAchiveSearcher2.00.C
A perl script to search the Digit magazines data base of previous issues.
Rediff Virus Remover1.00.A
This was created to to remove the RediffBol virus from HTML Files.
 


Formatering
1st Impression Formater1.00.A
This script will convert BootRecorder format of one line jokes to 1st Impression Format. Will space words according to the screen space.
ReNamer1.00.A
For extracting one specific line from HTML files from '$search_string' to '$end_string' and give the file that line as its name.
ExtractnNamer1.00.A
This will expract a specified line(specified as a regular expression) and then give it as the name of the file.
LineExtracter1.00.A
Copies all lines in the file "$file" with the text "$search" in them to a new user specifed file and all the lines without that text to another file


HTML Helpers
Linked File Mover1.00.A
This will move all the files linked in a html file to a new user defined folder.
HttpToFile1.04.A
This will correct the links of all the html files within a folder. The html files must be taken from the internet thru IE's save function. This will also corrects the image links, script links and style sheet links.


MP3 CD Indexer
M3U Collector1.01.A
Input a winamp playlist of a MP3 CD and this script will analyze it and save the results to a Database that can be searched with the Searcher script.
M3U Searcher1.00.A
Searchs a Database that is created by the M3U collector for a user specified song or artist.


Some CGI Scripts are also available...

Comments

Juno at 07 Mar, 2007 05:20
Hi,

Looks like u might be able to help me.
I have .pag files that i need to be converted to .txt files.
This has to happen for all the files under all folders and subfolders.

For Eg: Lets consider a folder structure in a unix box : data/year/org1/org2/org3 ....
The script must be able to create the same folder structure in another location and convert all the .pag files to .txt retaining their respective folders.
i.e, if a file "test.pag" in the folder /data/year/ in the unix box , i have to convert tthe test.pag to test.txt and put it in the other location /data/year/.

I hope i make sense.
If you can .. pls do help .. its urgent.

Thanks,
Juno

Reply to this.
Binny V A at 08 Mar, 2007 05:46
Just copy the entire folder to another folder. Now in the new folder run this command...
find . -name "*.pag" -exec rename .pag .txt {} ;

I am assuming you have a unix box - if its a windows machine, this will be much harder.
Reply to this.
Amit at 18 May, 2007 07:24
Hello,

I have similar reqmt like your LineExtracter script. I need to filter the lines based on the search to a new file. That will be much help if you can upload this script.

Thanks,
Amit
Reply to this.
Anonymous at 23 Jun, 2007 05:34
how to run a cgi script by using perl.
regards,
senthil,
Reply to this.
Binny V A at 23 Jun, 2007 09:21
Install Perl. Then at the command line run the command 'perl [file.cgi]'

Thats all.
Reply to this.
Anonymous - Boston at 11 Jul, 2007 05:26
Hi,

I have a perl script that I need to run either as a bat file or an exe, we are a windows shop and I am trying to get an old report I had that ran on Linix to work here at my new shop that has windows. Is there an easy way to convert the perl script to a bat file or exe?
Reply to this.
Binny V A at 11 Jul, 2007 02:35
A much better and easier method is to install Perl in Windows. You can get the windows port of Perl - it is called ActivePerl.
Reply to this.
Shivangi Agrawal at 16 Jul, 2007 03:16
Hi,

I have an output file like this:
080480-8108000 r-xp 0000 /delsoft/PbdProfiler/SPYGLASS_HOME/obj/check.Linux2
b06fa0-b07040 r-xp 00000 /delsoft/tcl_perl_interface/arch/auto/Tcl/Tcl.so
b06fa0-b07040 r-xp 00000 /delsoft/tcl_perl/arch/auto/Tcl/Tcl.so

and so on....

I need to print only the first column and the last column using Hashes of Arrays.........

So i need help in this regard.

Thanks and Regards,

Shivangi
Reply to this.
Anonymous at 03 Sep, 2007 11:49
Hi Please send me the Shell scripts . What ever you have return . I have a good exposure in shell scripting therotically. If U have send the shell scripts then i can work on it and can gain som practical Exposure too

Please do the needful
Venki
Reply to this.
rda at 10 Oct, 2007 11:54
Hello,

I need a Perl script to apply a regular expression on a text file and return the match. I use the applescript command do shell script" perl -e . I am new to perl, co these example could be usefull...

Thanks in advance...

Rda
Reply to this.
Anonymous at 31 Oct, 2007 09:11
Hi I am Linux administrator from Rajkot Gujrat India
Reply to this.
Anonymous at 23 Jan, 2008 10:17
#!/usr/local/bin/perl
$reportname=$ARGV[0];
$count=$ARGV[1];
#print "$reportname$count";
$FILE_NAME="$ENV{AI_SERIAL_LOOKUP}/fwore_file_time.dat";
#print "$FILE_NAME";
open(DAT, $FILE_NAME)|| die("Could not open file!");
@raw_data=<DAT>;
close(DAT);
foreach $record (@raw_data)
{
@test_array=split /,/, $record;
$array_size=@test_array;
$test_string="";
if (lc($reportname) eq lc($test_array[0]))
{
if($count == $test_array[1])
{print"0";}
else
{
$i=2;
while($i <= $array_size)
{
$test_roc_string="$test_roc_string, $test_array[$i]";
$i=$i+1;
}
$test_roc_string = substr($test_roc_string, 2, length($test_roc_string)-6);
if (lc($reportname) eq 'apecs')
{
print"For APCES source, we are expecting 2 files.";
}
else
{
print"For report $reportname, we are expecting files from the following ROCs: $test_roc_string";
}
}
}
}
Reply to this.
Comment


Comment




Comment Formating : HTML tags a, strong, em, b, i, code, pre, p and br allowed. Other tags will be shown as code(< will become &lt;). Urls, Line breaks will be auto-formated.
Subscribe to Feed