Re: help me with a parsing script please

2011-05-13 Thread Rob Dixon
On 12/05/2011 10:23, Nathalie Conte wrote: HI, I have this file format chr start end strand x 12 24 1 x 24 48 1 1 100 124 -1 1 124 148 -1 Basically I would like to create a new file by grouping the start of the first line (12) with the end of the second line (48) and so on the output should lo

Re: help me with a parsing script please

2011-05-12 Thread Peter Lanting
On Thu, May 12, 2011 at 11:23 AM, Nathalie Conte wrote: HI, I have this file format chrstartendstrand x 12241 x24481 1100124-1 1124148-1 Basically I would like to create a new file by grouping the start of the first line (12) with the

Re: help me with a parsing script please

2011-05-12 Thread Mike McClain
On Thu, May 12, 2011 at 10:23:29AM +0100, Nathalie Conte wrote: > I have this file format > chrstartendstrand > x 12241 > I have this script to split and iterate over each line, but I don't > know how to group 2 lines together, and take the start of the firt line > and

Re: help me with a parsing script please

2011-05-12 Thread Brian Fraser
On Thu, May 12, 2011 at 6:23 AM, Nathalie Conte wrote: > I have this script to split and iterate over each line, but I don't know > how to group 2 lines together, and take the start of the firt line and the > end on the second line? could you please advise? thanks > > You have a couple of option

Re: help me with a parsing script please

2011-05-12 Thread John W. Krahn
Nathalie Conte wrote: HI, Hello, I have this file format chr start end strand x 12 24 1 x 24 48 1 1 100 124 -1 1 124 148 -1 Basically I would like to create a new file by grouping the start of the first line (12) with the end of the second line (48) and so on the output should look like thi

Re: help me with a parsing script please

2011-05-12 Thread Rob Coops
You are almost there :-) my ($helper1, $helper2); my $counter = 1; foreach my $line(@list){ chomp $line; my @coordinates = split(/' '/, $region); my $chromosome = $coordinates[0]; my $start = $coordinates[1]; my $end = $coordinates[2]; my $strand = $coordinates[3