Re: Parsing a microarray data file

2012-01-26 Thread John W. Krahn
Steve Bertrand wrote: On 2012.01.26 12:59, Chris Stinemetz wrote: #!/usr/bin/perl use warnings; use strict; while ( ) { chomp; my @array = split; my $GeneID = $array[6]; if ($GeneID =~ /^C|D/) { print $_,"\n"; } } __DATA__ Line1 c 2 3 4 5 C 7 8 9 Line2 1 2 3 4 5 6 7 8 9 Line3 1 2 3 4 5 D 7 8

Re: Parsing a microarray data file

2012-01-26 Thread John W. Krahn
Chris Stinemetz wrote: ***tested*** #!/usr/bin/perl use warnings; use strict; while ( ) { chomp; my @array = split; my $GeneID = $array[6]; if ($GeneID =~ /^C|D/) { I'm still learning regex but it could be better written with; if ($GeneID =~ /^[CD]/) { Plus they do two different t

Re: Parsing a microarray data file

2012-01-26 Thread Steve Bertrand
On 2012.01.26 12:59, Chris Stinemetz wrote: Hello Tiago, On Thu, Jan 26, 2012 at 11:08 AM, Tiago Hori wrote: Hi All, I need some help to get started on a script. I have these huge data files 16K rows and several columns. I need to parse the rows into a subset of these 16K rows. Each rows has

Re: Parsing a microarray data file

2012-01-26 Thread Tiago Hori
Thanks Chris! I am going to give this a go now! Cheers, T. On Thu, Jan 26, 2012 at 2:40 PM, Chris Stinemetz wrote: > > ***tested*** > > > > #!/usr/bin/perl > > use warnings; > > use strict; > > > > while ( ) { > > chomp; > > my @array = split; > > my $GeneID = $array[6]; > > > > if ($Ge

Re: Parsing a microarray data file

2012-01-26 Thread Chris Stinemetz
> ***tested*** > > #!/usr/bin/perl > use warnings; > use strict; > > while ( ) { >  chomp; >  my @array = split; >  my $GeneID = $array[6]; > >  if ($GeneID =~ /^C|D/) { I'm still learning regex but it could be better written with; if ($GeneID =~ /^[CD]/) { -- To unsubscribe, e-mail: beginners-u

Re: Parsing a microarray data file

2012-01-26 Thread Chris Stinemetz
Hello Tiago, On Thu, Jan 26, 2012 at 11:08 AM, Tiago Hori wrote: > Hi All, > > I need some help to get started on a script. > > I have these huge data files 16K rows and several columns. I need to parse > the rows into a subset of these 16K rows. Each rows has a identifier made > up of 2 letters

Parsing a microarray data file

2012-01-26 Thread Tiago Hori
Hi All, I need some help to get started on a script. I have these huge data files 16K rows and several columns. I need to parse the rows into a subset of these 16K rows. Each rows has a identifier made up of 2 letters and 6 numbers and the ones I want have specific letter, they start with either