Re: parsing file need help please

2011-06-08 Thread Jim Gibson
On 6/8/11 Wed Jun 8, 2011 7:48 AM, "Nathalie Conte" scribbled: > HI, > Me again with another parsing script :) > this time, I have this file format, see below, I want to assess if the > genotyping data ( 2 letters at the beginning) are the same in column 1 > or 2, NN should be ignored (as no re

parsing file need help please

2011-06-08 Thread Nathalie Conte
HI, Me again with another parsing script :) this time, I have this file format, see below, I want to assess if the genotyping data ( 2 letters at the beginning) are the same in column 1 or 2, NN should be ignored (as no results provided). I should count as well the number of heterozygous ( when

Parsing file

2011-06-02 Thread Aravind Venkatesan
Hi, I want to parse a file with contents that looks as follows: ENTRY K1 KO NAMEE1.1.1.1, adh DEFINITION alcohol dehydrogenase [EC:1.1.1.1] PATHWAY ko00010 Glycolysis / Gluconeogenesis ko00071 Fatty acid metabolism /// ENTRY

Re: Parsing file

2011-06-02 Thread Rob Coops
On Thu, Jun 2, 2011 at 8:32 PM, venkates wrote: > Hi, > > Thanks a lot for the help, i had one more question. How can add diff values > from multiple lines to the same hash ref? for example in the snippet data > > > PATHWAY ko00010 Glycolysis / Gluconeogenesis >ko00071 Fatty aci

Re: Parsing file

2011-06-02 Thread venkates
Hi, Thanks a lot for the help, i had one more question. How can add diff values from multiple lines to the same hash ref? for example in the snippet data PATHWAY ko00010 Glycolysis / Gluconeogenesis ko00071 Fatty acid metabolism ko00350 Tyrosine metabolism

Re: Parsing file

2011-06-02 Thread Rob Coops
On Thu, Jun 2, 2011 at 4:41 PM, venkates wrote: > On 6/2/2011 2:44 PM, Rob Coops wrote: > >> On Thu, Jun 2, 2011 at 1:28 PM, venkates wrote: >> >> On 6/2/2011 12:46 PM, John SJ Anderson wrote: >>> >>> On Thu, Jun 2, 2011 at 06:41, venkates wrote: Hi, > > I want to parse a

Re: Parsing file

2011-06-02 Thread venkates
On 6/2/2011 2:44 PM, Rob Coops wrote: On Thu, Jun 2, 2011 at 1:28 PM, venkates wrote: On 6/2/2011 12:46 PM, John SJ Anderson wrote: On Thu, Jun 2, 2011 at 06:41, venkates wrote: Hi, I want to parse a file with contents that looks as follows: [ snip ] Have you considered using this mo

Re: Parsing file

2011-06-02 Thread Rob Coops
On Thu, Jun 2, 2011 at 1:28 PM, venkates wrote: > On 6/2/2011 12:46 PM, John SJ Anderson wrote: > >> On Thu, Jun 2, 2011 at 06:41, venkates wrote: >> >>> Hi, >>> >>> I want to parse a file with contents that looks as follows: >>> >> [ snip ] >> >> Have you considered using this module? -> >>

Re: Parsing file

2011-06-02 Thread venkates
On 6/2/2011 12:46 PM, John SJ Anderson wrote: On Thu, Jun 2, 2011 at 06:41, venkates wrote: Hi, I want to parse a file with contents that looks as follows: [ snip ] Have you considered using this module? -> Alternatively, I think someb

Re: Parsing file

2011-06-02 Thread John SJ Anderson
On Thu, Jun 2, 2011 at 06:41, venkates wrote: > Hi, > > I want to parse a file with contents that looks as follows: [ snip ] Have you considered using this module? -> Alternatively, I think somebody on the BioPerl mailing list was working o

Parsing file

2011-06-02 Thread venkates
Hi, I want to parse a file with contents that looks as follows: ENTRY K1 KO NAMEE1.1.1.1, adh DEFINITION alcohol dehydrogenase [EC:1.1.1.1] PATHWAY ko00010 Glycolysis / Gluconeogenesis ko00071 Fatty acid metabolism /// ENTRY

Re: Parsing file and regexp

2010-02-19 Thread Shawn H Corey
olivier.scalb...@algosyn.com wrote: > $ cat test.txt > keyword1 word1, word2 > word3; > blabla > > blabla > > > keyword2 > word4, word5, > word6, word7, word8, > word9; > > bla bla > bla bla > > keyword1 > word10, word11; #!/usr/bin/perl use strict; use warnings; use Data:

Re: Parsing file and regexp

2010-02-19 Thread olivier.scalb...@algosyn.com
Uri Guttman wrote: > > please show your code. there is no way to help otherwise. s/// is not a > > pattern matcher but a substitution operator. it uses regexes and can be > > used to parse things. > > > > uri > > Here it is ... $ cat test.txt keyword1 word1, word2 word3; blabla blabla ke

Re: Parsing file and regexp

2010-02-19 Thread olivier.scalb...@algosyn.com
(Sorry but I have problem with my ISP, so I repost !) Uri Guttman wrote: > > how do you know when a keyword section begins or ends? how large is this > > file? could free text have keywords? i see a ; to end a word list but > > that isn't enough to properly parse this if you have 'free text'. > >

Re: Parsing file and regexp

2010-02-13 Thread Uri Guttman
> "osc" == olivier scalb...@algosyn com > writes: osc> keywordA word1, word2, word3; osc> Here we can have some free text osc> ... osc> ... osc> keywordB word4, osc> word5, word6, word7, word8, osc> word9, word10; osc> KeywordA osc

Parsing file and regexp

2010-02-13 Thread olivier.scalb...@algosyn.com
Hello, I need to extract info from some text files. And I want to do it with Perl ! The file I need to parse has the following layout: keywordA word1, word2, word3; Here we can have some free text ... ... keywordB word4, word5, word6, word7, word8, word9, word10

Re: Parsing file line by line.

2009-03-10 Thread Telemachus
On Tue Mar 10 2009 @ 4:13, Meghanand Acharekar wrote: > Hi, > > Need some help > How can I parse a file line by line using perl. > > I want to parse a test file having following data format > > *File : user_stats.txt* > 20GB Larry > 14.5MB Bob > 3MBJohn > > so that I can send th

Parsing file line by line.

2009-03-10 Thread Meghanand Acharekar
Hi, Need some help How can I parse a file line by line using perl. I want to parse a test file having following data format *File : user_stats.txt* 20GB Larry 14.5MB Bob 3MBJohn so that I can send this data to a MySQL database table. Can I use while loop (any other loop control)

Re: Need help parsing file for output

2007-11-02 Thread Tom Phoenix
On 11/2/07, Gerald Wheeler <[EMAIL PROTECTED]> wrote: > No modules other than what comes with the basic perl installation are > available. Well, it's fortunate that so many modules come with Perl, then. Still, there are always more modules on CPAN if you need them. [Long description of task snip

Need help parsing file for output

2007-11-02 Thread Gerald Wheeler
Running Perl 5.x on Solaris 9 SPARC No modules other than what comes with the basic perl installation are available. I have a file: file1.csv as such: Day of the year, value 1,4144.34 2,4144.38 3,4144.38 4,4144.38 5,4144.44 6,4144.48 7,4144.48 8,4144.50 9,4144.50 10,4144.48 11,4144.50 12,4144.52 1

Re: need help parsing file for output

2007-09-26 Thread Gerald Wheeler
Thank you both... much appreciated.. Jerry >>> "Dr.Ruud" <[EMAIL PROTECTED]> 09/25/07 5:10 PM >>> "John W. Krahn" schreef: > open my $IN, '<', $file_in or die "Cannot open '$file_in' $!" > open my $OUT, '>', $file_out or die "Cannot open '$file_out' $!" These lines could use a ";" at the end

Re: need help parsing file for output

2007-09-25 Thread John W. Krahn
Dr.Ruud wrote: "John W. Krahn" schreef: open my $IN, '<', $file_in or die "Cannot open '$file_in' $!" open my $OUT, '>', $file_out or die "Cannot open '$file_out' $!" These lines could use a ";" at the end. Oops. Thanks. John -- Perl isn't a toolbox, but a small machine shop where you

Re: need help parsing file for output

2007-09-25 Thread Dr.Ruud
"John W. Krahn" schreef: > open my $IN, '<', $file_in or die "Cannot open '$file_in' $!" > open my $OUT, '>', $file_out or die "Cannot open '$file_out' $!" These lines could use a ";" at the end. -- Affijn, Ruud "Gewoon is een tijger." -- To unsubscribe, e-mail: [EMAIL PROTECTED] For addit

Re: need help parsing file for output

2007-09-25 Thread John W. Krahn
Gerald Wheeler wrote: John, I am getting compile errors.. As for $! I am running Solaris 9 SPARC 64-bit.. errors: # perl -c readFiles.pl "my" variable $file_out masks earlier declaration in same scope at readFiles.pl line 10. "my" variable $file_out masks earlier declaration in same statement

Re: need help parsing file for output

2007-09-25 Thread Gerald Wheeler
Thanks... This is great... Thanks again! Jerry >>> "John W. Krahn" <[EMAIL PROTECTED]> 09/25/07 12:51 PM >>> Gerald Wheeler wrote: > I could use some real expert help here.. > I have only the basic - no add-on modules except what comes with Perl > > What is needed, Is this possible with Perl 5.

Re: need help parsing file for output

2007-09-25 Thread John W. Krahn
Gerald Wheeler wrote: I could use some real expert help here.. I have only the basic - no add-on modules except what comes with Perl What is needed, Is this possible with Perl 5.x.. read from file olddata.txt output to newdata.txt 1) output all numerics inside parenthesis to negative values

Re: need help parsing file for output

2007-09-25 Thread Paul Lalli
On Sep 25, 12:34 pm, [EMAIL PROTECTED] (Gerald Wheeler) wrote: > I could use some real expert help here.. No you could use some real basic help here. There is nothing in your requirements that indicates the need for an "expert" of any sort. > I have only the basic - no add-on modules except what

need help parsing file for output

2007-09-25 Thread Gerald Wheeler
I could use some real expert help here.. I have only the basic - no add-on modules except what comes with Perl What is needed, Is this possible with Perl 5.x.. read from file olddata.txt output to newdata.txt 1) output all numerics inside parenthesis to negative values e.g., (32) should output

Re: help parsing file

2002-12-18 Thread Pedro Antonio Reche
Bob Showalter wrote: > > > -Original Message- > > From: Pedro Antonio Reche [mailto:[EMAIL PROTECTED]] > > Sent: Tuesday, December 17, 2002 7:22 PM > > To: [EMAIL PROTECTED] > > Subject: help parsing file > > > > > > ... I am not > >

RE: help parsing file

2002-12-18 Thread Bob Showalter
> -Original Message- > From: Pedro Antonio Reche [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, December 17, 2002 7:22 PM > To: [EMAIL PROTECTED] > Subject: help parsing file > > > ... I am not > please with it, as it generates an empty element in the hash fr

Re: help parsing file

2002-12-18 Thread Pedro Antonio Reche
"John W. Krahn" wrote: > > Pedro Antonio Reche wrote: > > > > Hi, I am interested in parsing the file at the bottom of this e-mail in > > order to extract the string between "" following /product=, > > /protein_id=, /db_xref= and /translation=, and that for each of the > > segment separated by t

Re: help parsing file

2002-12-17 Thread John W. Krahn
Pedro Antonio Reche wrote: > > Hi, I am interested in parsing the file at the bottom of this e-mail in > order to extract the string between "" following /product=, > /protein_id=, /db_xref= and /translation=, and that for each of the > segment separated by the string "CDS". The ouptput for the

help parsing file

2002-12-17 Thread Pedro Antonio Reche
Hi, I am interested in parsing the file at the bottom of this e-mail in order to extract the string between "" following /product=, /protein_id=, /db_xref= and /translation=, and that for each of the segment separated by the string "CDS". The ouptput for the example bellow should look like this:

Re: help parsing file

2002-04-22 Thread drieux
On Monday, April 22, 2002, at 10:01 , Timothy Johnson wrote: > > Funny you should mention it. My product manager just requested blood > from a > stone two weeks ago. Now he's threatening to outsource it... warning to those new to perl - DO NOT TRY THIS. These are Paid Professionals Using th

RE: help parsing file

2002-04-22 Thread Timothy Johnson
bject: RE: help parsing file >-Original Message- >From: drieux [mailto:[EMAIL PROTECTED]] > >speaking of which - how DO we improve the quality of the problem >specs - both amongst beginners and 'product managers' - the former >at least seem open to learning while

Help Helpers Help You - was Re: help parsing file

2002-04-22 Thread drieux
On Monday, April 22, 2002, at 08:23 , Jackson, Harry wrote: >> -Original Message- >> From: drieux [mailto:[EMAIL PROTECTED]] >> >> speaking of which - how DO we improve the quality of the problem >> specs - both amongst beginners and 'product managers' - the former >> at least seem open

RE: help parsing file

2002-04-22 Thread Jackson, Harry
>-Original Message- >From: drieux [mailto:[EMAIL PROTECTED]] > >speaking of which - how DO we improve the quality of the problem >specs - both amongst beginners and 'product managers' - the former >at least seem open to learning while the latter. For the former is there an acceptable

RE: help parsing file

2002-04-22 Thread Bob Showalter
> -Original Message- > From: drieux [mailto:[EMAIL PROTECTED]] > Sent: Friday, April 19, 2002 5:37 PM > To: [EMAIL PROTECTED] > Subject: Re: help parsing file > > > > On Friday, April 19, 2002, at 02:17 , Bob Showalter wrote: > [..] > >> On Fri

Re: B/C - Re: help parsing file (fwd)

2002-04-19 Thread Jeff 'japhy' Pinyan
-- Forwarded message -- Date: Fri, 19 Apr 2002 19:06:30 -0400 (EDT) From: Jeff 'japhy' Pinyan <[EMAIL PROTECTED]> Reply-To: [EMAIL PROTECTED] To: drieux <[EMAIL PROTECTED]> Subject: Re: B/C - Re: help parsing file On Apr 19, drieux said: >> w

Re: help parsing file

2002-04-19 Thread drieux
On Friday, April 19, 2002, at 03:09 , Jeff 'japhy' Pinyan wrote: [..] > First, I'd use a regex trick of //g in scalar context, and /^/m. > > while () { > next unless /^$prefix/; > $_ .= while /^$prefix/gm; > print; > } I'm not sure I understand the 'exit' strategy here. assume t

Re: help parsing file

2002-04-19 Thread John W. Krahn
Timothy Johnson wrote: > > In that case, you could always change > > ###my $nextLine = ; > > to > > ###my $nextLine = unless $nextline =~ /^$prefix/; That won't work because the $nextLine in $nextLine =~ /^$prefix/ is a global variable and the $nextLine in my $nextLine

Re: help parsing file

2002-04-19 Thread Jeff 'japhy' Pinyan
On Apr 19, drieux said: >### while() { >### if( /^$prefix/ ) { >### print "$_"; >### my $nextLine = $_; >### while ( $nextLine =~ /^$prefix/ ){ >### $nextLine = ; >### print "$nextLine"; >### } >### } >### } # end while I would foll

RE: help parsing file

2002-04-19 Thread Timothy Johnson
Actually, yeah, spoke too soon. -Original Message- From: drieux [mailto:[EMAIL PROTECTED]] Sent: Friday, April 19, 2002 2:52 PM To: [EMAIL PROTECTED] Subject: Re: help parsing file On Friday, April 19, 2002, at 02:13 , Timothy Johnson wrote: > > In that case, you could

Re: help parsing file

2002-04-19 Thread drieux
On Friday, April 19, 2002, at 02:13 , Timothy Johnson wrote: > > In that case, you could always change > > ### my $nextLine = ; > > to > > ###my $nextLine = unless $nextline =~ /^$prefix/; Contract negotiable I'm actually having problems getting that to work... "File "J

Re: help parsing file

2002-04-19 Thread drieux
On Friday, April 19, 2002, at 02:17 , Bob Showalter wrote: [..] >> On Friday, April 19, 2002, at 12:29 , Pedro A Reche Gallardo wrote: >> >>> I am trying to print only the line that contain the ">" symbol and the >>> next line. Bob, I will defer to Pedro on this - my reading had been that given

RE: help parsing file

2002-04-19 Thread Timothy Johnson
EMAIL PROTECTED]' Subject: RE: help parsing file > -Original Message- > From: drieux [mailto:[EMAIL PROTECTED]] > Sent: Friday, April 19, 2002 4:55 PM > To: [EMAIL PROTECTED] > Subject: Re: help parsing file > > > > On Friday, April 19, 2002, at 12:29 , Pe

RE: help parsing file

2002-04-19 Thread Bob Showalter
> -Original Message- > From: drieux [mailto:[EMAIL PROTECTED]] > Sent: Friday, April 19, 2002 4:55 PM > To: [EMAIL PROTECTED] > Subject: Re: help parsing file > > > > On Friday, April 19, 2002, at 12:29 , Pedro A Reche Gallardo wrote: > > > HI, I

Re: help parsing file

2002-04-19 Thread Pedro A Reche Gallardo
Hi Drieux, thanks a lot for the help. Your program is working very well. My best wishes for you. Pedro *** PEDRO A. RECHE , pHDTL: 617 632 3824 Dana-Farber Cancer Institute, FX: 617 632 4569 Harvard Medical School,

Re: help parsing file

2002-04-19 Thread drieux
On Friday, April 19, 2002, at 12:29 , Pedro A Reche Gallardo wrote: > HI, I have a file that it could be devided in set of lines, each set > startingi with a line that has the ">" symbol. Of everyset of lines, I > am trying to print only the line that contain the ">" symbol and the > next line.

RE: help parsing file

2002-04-19 Thread Timothy Johnson
al Message- From: Pedro A Reche Gallardo [mailto:[EMAIL PROTECTED]] Sent: Friday, April 19, 2002 12:30 PM To: [EMAIL PROTECTED] Subject: help parsing file HI, I have a file that it could be devided in set of lines, each set startingi with a line that has the ">" symbol. Of everys

help parsing file

2002-04-19 Thread Pedro A Reche Gallardo
HI, I have a file that it could be devided in set of lines, each set startingi with a line that has the ">" symbol. Of everyset of lines, I am trying to print only the line that contain the ">" symbol and the next line. Please see below. Any help welcome. Regards, Example file >sptrembl|Q22966|Q2