RE: absolute newbie: tab-delimited files

2003-08-27 Thread Bob Showalter
Christiane Nerz wrote: > Hi everybody! > > I'm trying to read in an array every first String (Id-number) per line > out of tab-delimited text-files. > I only know how to read in complete lines per: > ... > chomp ($filename1 = ); > open(FILE1, $filename1); > @input1 = ; @input1 = map +(split /\t/)

Re: absolute newbie: tab-delimited files

2003-08-27 Thread Marius Roets
Try on of these 2 options: #!/usr/bin/perl ... chomp ($filename1 = ); #open(FILE1, $filename1); [EMAIL PROTECTED] = ; @input1 = ; print ("lines : @lines\n"); ### Option 1 foreach (@input1) { /^(\w+)\s/; ## Asuming the id is alpha numerical push (@ids1,