Umm, so I'm trying to do a routine add to mysql. First I'm parsing a file with perl to find the parts that I want. Well when I go to split the file I get nothing.
Code:
#usr/bin/perl -w
use strict;
#use DBI:
my $HMP_mol = "mcard_sdf_all.txt";
open HMP_SDF, ($HMP_mol) or die "Couldn't open file $HMP_mol; $! \n";
#-----Globals-----
my (@sdf,@HMP);
#-----sdf -> mol conversion------
while (my $line =<HMP_SDF>){
my $everything.=$line;
@sdf = split(/End of SDF File of HMDB/, $everything);
}
print "@sdf\n<-sdf\n"; # debug line
#-----Capturing lines from file-----
my $MET= "metabocards_all-noformat.txt";
open MET, ($MET) or die "Could not open file; $! \n";
while (my $row = <MET>){
#print "$row\n";
@HMP =split(/\n/, $row);
}
print "$HMP[2]\n<-HMP\n";
print "@HMP <-everything\n";
and the txt file is
Code:
Beginning of HMDB00001
# Accession_No:
HMDB00001
# Creation_Date:
2005-11-16 15:48:42
# Update_Date:
2006-09-20 15:58:12
# biospider_lastupdate:
0000-00-00 00:00:00
# Common_Name:
1-Methylhistidine
lots of stuff in the middle!!!!!!!
# Metabolic_Enzyme_4_References:
8182053; 8595053; 2217167; 8144586
End of HMDB00002
so there are two txt files to be honest but I've given just one. Whats odd is it doesn't matter if I split by new line or anything else I get nothing!