I wasnt sure which section to put this into the perl or php, but I need some major help, I am having a tuff time even though its a small script, I have done much bigger ones then this one, but I have no idea what to do now. So can someone please help me convert this perl to php. Thanks
--------------------------------------------------------------------------
#! /usr/bin/perl -w
# this script will take data from disConnectND and parse it and output a clean format
# this is data that was copied and pasted from disConnectND course schedule
# @lines = split /\n/, `cat /usr/local/admin/scripts/txt/summer04.txt`;
@lines = split /\n/, `cat /usr/local/www/apps.vcsu.edu/asp/ConnectND`;
$x = 0;
while( $x < 35) {
shift @lines; $x++;
}
$i=0;
foreach $line(@lines) {
if( ($line and $line ne '' and !($line =~ m/^\t$|^\s+$/)) or $line eq '0' ) {
if( $line =~ m/^Class Nbr/ ) { $i=0; }
if( $i > 0 and $i < 11 ) { print "$line,"; }
elsif( $i == 15 ) {
if( $line =~ m/AM|PM/ ) { print "$line-"; }
else { print ""; }
}
elsif( $i == 16 ) {
if( $line =~ m/AM|PM/ ) { print "$line,"; }
else { print ","; }
}
elsif( $i == 17 ) { print "$line,"; }
elsif( $i == 18 ) {
($building,$roomNum) = split / RM /, $line;
if( !$roomNum ) { $roomNum = ''; }
print "$building,$roomNum,";
}
elsif( $i == 23 ) { print "$line\n"; }
# print "$i= [$line]\n";
$i++;
}
}
-------------------------------------------------------------------------