Re: Splitting "Large" SQL Script Into Several; Concat Hash Doesn't Match

2012-02-14 Thread Brandon McCaig
On Tue, Feb 14, 2012 at 07:59:18PM +0200, Shlomi Fish wrote: > Hi Brandon, Hi Shlomi: tl;dr: Fixed. See bottom of message for diff. > What I would do is write another program (possibly in Perl) to > compare the differences and report immediately the location > within the two files, and the conte

Re: Splitting "Large" SQL Script Into Several; Concat Hash Doesn't Match

2012-02-14 Thread Shlomi Fish
Hi Brandon, On Tue, 14 Feb 2012 12:12:07 -0500 Brandon McCaig wrote: > Hello: > > tl;dr: A program indended to split a large MS SQL script into > smaller ones appears to be losing data. See below for the script. > I guess that maybe I'm making a silly mistake with newlines or > file encoding or

Re: Splitting "Large" SQL Script Into Several; Concat Hash Doesn't Match

2012-02-14 Thread Brandon McCaig
On Tue, Feb 14, 2012 at 12:12:07PM -0500, Brandon McCaig wrote: > The program follows (also attached in case my wrapping for mail > breaks something): I knew I would forget to attach it. :-X This time hopefully I remember.. Regards, -- Brandon McCaig Castopulence Software

Re: Splitting and printing on a single line

2012-01-05 Thread John W. Krahn
bob wrote: Hello Hello, I am very new to perl and I need some guidance on the following issue My data set is like this --- Record 38 Richard Nixon http://en.wikipedia.org/wiki/Richard_Nixon --- Record 39 Gerald Ford http://en.wikipedia.org/wik

Re: Splitting URL into Patterns

2011-07-13 Thread Jim Gibson
On 7/13/11 Wed Jul 13, 2011 8:53 AM, "AKINLEYE" scribbled: > please I need to split a bunch of URL into their respective domain name > like abcd.com , it path direcory like /~bert/build/ , it's Argument > constitutent like uid =1 > > Take for example > msprogram.cn/update/ld.php?ld.php&id=19

Re: Splitting URL into Patterns

2011-07-13 Thread Shlomi Fish
Hi Akinleye, On Wed, 13 Jul 2011 16:53:35 +0100 AKINLEYE wrote: > please I need to split a bunch of URL into their respective domain name > like abcd.com , it path direcory like /~bert/build/ , it's Argument > constitutent like uid =1 > > Take for example > msprogram.cn/update/ld.php?ld.php&i

Re: splitting and replacing characters

2009-11-09 Thread tom smith
On Mon, Nov 9, 2009 at 8:30 PM, tom smith wrote: > > On Mon, Nov 9, 2009 at 10:56 AM, Jim Gibson wrote: > >> However, here is a shortened form using regular expression: >> >> my @output = $line =~ m{ \G (..) .. }gx; >> >> Verify how either of these works when you do not have a multiple of 2 >> c

Re: splitting and replacing characters

2009-11-09 Thread tom smith
On Mon, Nov 9, 2009 at 10:56 AM, Jim Gibson wrote: > However, here is a shortened form using regular expression: > > my @output = $line =~ m{ \G (..) .. }gx; > > Verify how either of these works when you do not have a multiple of 2 > characters in your input. > > It has other problems too: use

Re: splitting and replacing characters

2009-11-09 Thread John W. Krahn
rithu wrote: Hi, Hello, Please help me to split a string as follows.. my $line = "abcdefghijkl" the expected output should be like: ab ef ij The logic is like alternate 2 characters should be removed $ perl -le' my $line = "abcdefghijkl"; my @data = unpack "(a2x2)*", $line; print f

Re: splitting and replacing characters

2009-11-09 Thread Robert Wohlfarth
On Mon, Nov 9, 2009 at 7:03 AM, rithu wrote: > Please help me to split a string as follows.. > > my $line = "abcdefghijkl" > > the expected output should be like: > > ab > ef > ij > > > The logic is like alternate 2 characters should be removed > Will a "for" loop work for your needs? The on

Re: splitting and replacing characters

2009-11-09 Thread Jim Gibson
On 11/9/09 Mon Nov 9, 2009 5:03 AM, "rithu" scribbled: > Hi, > > Please help me to split a string as follows.. > > my $line = "abcdefghijkl" > > the expected output should be like: > > ab > ef > ij > > > The logic is like alternate 2 characters should be removed split would not be th

Re: Splitting two numbers joined by a minus sign

2007-11-09 Thread Rob Dixon
michael wang wrote: if the minus sign always there, then use s/// seems faster than split, like while(){ s/(\d)-/$1\t-/; print "$_"; } I'm pretty certain the OP wanted the data separated into fields so it would still have to be split. I do like the idea of adding the 'missing' space

Re: Splitting two numbers joined by a minus sign

2007-11-09 Thread michael wang
if the minus sign always there, then use s/// seems faster than split, like while(){ s/(\d)-/$1\t-/; print "$_"; } On 11/9/07, Paul Lalli <[EMAIL PROTECTED]> wrote: > > On Nov 9, 2:09 am, [EMAIL PROTECTED] (Rob Dixon) wrote: > > > > Why have you decided that the OP's solution doesn't p

Re: Splitting two numbers joined by a minus sign

2007-11-09 Thread Paul Lalli
On Nov 9, 2:09 am, [EMAIL PROTECTED] (Rob Dixon) wrote: > > Why have you decided that the OP's solution doesn't provide what he wants, > snipped it, and offered some code that does something very different? > and he asked for a more elegant way of doing the same thing. I would have > thought it wa

Re: Splitting two numbers joined by a minus sign

2007-11-08 Thread kens
On Nov 8, 3:32 pm, [EMAIL PROTECTED] (Demian) wrote: > Hello, > > I ran into a problematic file that combined two numeric columns into > one: > > ATOM325 CA GLU B 40 -30.254 72.432-297.620 1.00 > 10.00 C > ATOM326 CA ASP B 41 -28.149 73.031-294.529 1.00 > 10.00

Re: Splitting two numbers joined by a minus sign

2007-11-08 Thread Rob Dixon
Paul Lalli wrote: On Nov 8, 3:32 pm, [EMAIL PROTECTED] (Demian) wrote: Hello, I ran into a problematic file that combined two numeric columns into one: ATOM325 CA GLU B 40 -30.254 72.432-297.620 1.00 10.00 C ATOM326 CA ASP B 41 -28.149 73.031-294.529 1.00 1

Re: Splitting two numbers joined by a minus sign

2007-11-08 Thread Rob Dixon
Demian wrote: I ran into a problematic file that combined two numeric columns into one: ATOM325 CA GLU B 40 -30.254 72.432-297.620 1.00 10.00 C ATOM326 CA ASP B 41 -28.149 73.031-294.529 1.00 10.00 C ATOM327 CA GLU B 42 -27.716 76.690-29

Re: Splitting two numbers joined by a minus sign

2007-11-08 Thread John W . Krahn
On Thursday 08 November 2007 17:48, Paul Lalli wrote: > On Nov 8, 3:32 pm, [EMAIL PROTECTED] (Demian) wrote: > > > > I ran into a problematic file that combined two numeric columns > > into one: > > > > ATOM325 CA GLU B 40 -30.254 72.432-297.620 1.00 > > 10.00 C > > ATOM3

Re: Splitting two numbers joined by a minus sign

2007-11-08 Thread Paul Lalli
On Nov 8, 3:32 pm, [EMAIL PROTECTED] (Demian) wrote: > Hello, > > I ran into a problematic file that combined two numeric columns into > one: > > ATOM325 CA GLU B 40 -30.254 72.432-297.620 1.00 > 10.00 C > ATOM326 CA ASP B 41 -28.149 73.031-294.529 1.00 > 10.00

Re: Splitting two numbers joined by a minus sign

2007-11-08 Thread Rodrick Brown
On Nov 8, 2007 3:32 PM, Demian <[EMAIL PROTECTED]> wrote: > Hello, > > I ran into a problematic file that combined two numeric columns into > one: > > ATOM325 CA GLU B 40 -30.254 72.432-297.620 1.00 > 10.00 C > ATOM326 CA ASP B 41 -28.149 73.031-294.529 1.00 > 1

Re: Splitting a CSV file at a variable number

2007-06-29 Thread Chas Owens
On 6/28/07, sum_duud <[EMAIL PROTECTED]> wrote: in essence I would like the perl script to output all the fourth column "0" values to a file called phase_0.csv and all the "1" values to phase_1.csv etc. snip use an array of file handles (warning, untested): use strict; use warnings; open my $

Re: splitting the line correctly

2006-09-10 Thread Xavier Mas i Ramón
A Diumenge 10 Setembre 2006 01:56, Robert Krueger va escriure: > Hi, > I bought 3 books a few days ago on Perl, and things are going well with > one exception. > > An example: > > @line = "this is a very long line word1+word2+word3 and it contines on and > on"; > > The object is to execute a spli

Re: splitting the line correctly

2006-09-09 Thread John W. Krahn
Robert Krueger wrote: > Hi, Hello, > I bought 3 books a few days ago on Perl, and things are going well with > one exception. > > An example: > > @line = "this is a very long line word1+word2+word3 and it contines on and > on"; > > The object is to execute a split using "+" so I end up with w

Re: splitting the line correctly

2006-09-09 Thread Rob Dixon
Robert Krueger wrote: > Hi, > I bought 3 books a few days ago on Perl, and things are going well with > one exception. > > An example: > > @line = "this is a very long line word1+word2+word3 and it contines on and on"; > > The object is to execute a split using "+" so I end up with word1, word2,

Re: splitting strings

2006-08-30 Thread Hien Le
On Aug 30, 2006, at 3:42 AM, Dr.Ruud wrote: Aaargh, I was suddenly mixing up split /()/ and /()/g. I really shouldn't post anymore without testing. Thank you all for the clarifications regarding split(). I should pay more attention when I read the documentation (or get more sleep). -Hien.

Re: splitting strings

2006-08-29 Thread Dr.Ruud
"Mumia W." schreef: > Dr.Ruud: >> Mumia W.: >>> my @bar2 = grep length, split (/([a-z]{5})/, $foo); >>> >>> Any substrings with a length of zero will be removed by "grep >>> length." >> >> Huh? Why not just remove the capturing "()"? > > Without the capturing parentheses, split will remove every >

Re: splitting strings

2006-08-29 Thread Mumia W.
On 08/29/2006 05:02 PM, Dr.Ruud wrote: "Mumia W." schreef: Hien Le: [...] # Method 2 print( "\nMethod 2\n" ); my @bar2 = split( /([a-z]{5})/, $foo );# Captures white-spaces ?!? [...] The comments made by Dr. Ruud and John W. Krahn are correct. Split is returning the empty strings between

Re: splitting strings

2006-08-29 Thread Dr.Ruud
"Mumia W." schreef: > Hien Le: >> [...] >> # Method 2 >> print( "\nMethod 2\n" ); >> my @bar2 = split( /([a-z]{5})/, $foo );# Captures white-spaces >> ?!? [...] > > The comments made by Dr. Ruud and John W. Krahn are correct. > Split is returning the empty strings between delimiter > segments

Re: splitting strings

2006-08-29 Thread Mumia W.
On 08/29/2006 06:52 AM, Hien Le wrote: [...] # Method 2 print( "\nMethod 2\n" ); my @bar2 = split( /([a-z]{5})/, $foo );# Captures white-spaces ?!? [...] The comments made by Dr. Ruud and John W. Krahn are correct. Split is returning the empty strings between delimiter segments in the ori

Re: splitting strings

2006-08-29 Thread John W. Krahn
Hien Le wrote: > Hello, Hello, > Given the string 'abcdefghijklmnopq', I wish to add a line break every > 5 characters: > > abcde > fghij > klmno > pq $ perl -e' my $foo = q[abcdefghijklmnopq]; print "$foo\n"; $foo =~ s/(.{0,5})/$1\n/g; print $foo; ' abcdefghijklmnopq abcde fghij klmno pq >

Re: splitting strings

2006-08-29 Thread Dr.Ruud
Hien Le schreef: > my @bar2 = split( /([a-z]{5})/, $foo );# Captures white-spaces ?!? Because of the capturing (), split also returns the separators. See perldoc -f split. Suggestion: my @bar2 = split( /./, $foo ); -- Affijn, Ruud "Gewoon is een tijger." -- To unsubscribe, e-

Re: Splitting a script into multiple files

2006-07-26 Thread Martin Tournoy
Great, thanks for the fast reply. I kindly accept all donations for a new laptop On 26/07/06, Timothy Johnson <[EMAIL PROTECTED]> wrote: Check out 'perldoc -f do'. Also, get a new laptop. :) -Original Message- From: Martin Tournoij [mailto:[EMAIL PROTECTED] Sent: Wednesday, July

RE: Splitting a script into multiple files

2006-07-26 Thread Timothy Johnson
Check out 'perldoc -f do'. Also, get a new laptop. :) -Original Message- From: Martin Tournoij [mailto:[EMAIL PROTECTED] Sent: Wednesday, July 26, 2006 10:05 AM To: beginners@perl.org Subject: Splitting a script into multiple files My laptop, on which I do all my Programming/Develo

Re: splitting on every other delimiter

2006-05-01 Thread John W. Krahn
Rance Hall wrote: > assume the following code: > > my $output = qx{systemcall}; > > assume that the output of the systemcall looks something like this > > name\n > value\n > name\n > value\n > name\n > value\n > name\n > value\n > name\n > value\n > name\n > value\n > ... > > what like to do is

Re: splitting on every other delimiter

2006-05-01 Thread Dr.Ruud
Rance Hall schreef: > name1\n > value1\n > name2\n > value2\n > ... > what like to do is get the name/value pairs into a hash of some sort There just was a thread on this on news:comp.language.perl.misc , see news:[EMAIL PROTECTED] and on. -- Affijn, Ruud "Gewoon is een tijger." -- To unsu

Re: splitting on every other delimiter

2006-05-01 Thread Rance Hall
Chas Owens wrote: On 5/1/06, Rance Hall <[EMAIL PROTECTED]> wrote: assume the following code: my $output = qx{systemcall}; assume that the output of the systemcall looks something like this name\n value\n snip what like to do is get the name/value pairs into a hash of some sort snip W

Re: splitting on every other delimiter @ 1146493312

2006-05-01 Thread Johan Meskens CS3 jmcs3
Intrah onat Diria .. Mon, 01 May 2006 09:06:21 -0500 , Rance Hall wrote "Revera y": > > For additional commands, e-mail: [EMAIL PROTECTED] > To unsubscribe, e-mail: [EMAIL PROTECTED] > -- > > > > [EMAIL PROTECTED] > 1-308

Re: splitting on every other delimiter

2006-05-01 Thread Chas Owens
On 5/1/06, Rance Hall <[EMAIL PROTECTED]> wrote: assume the following code: my $output = qx{systemcall}; assume that the output of the systemcall looks something like this name\n value\n snip what like to do is get the name/value pairs into a hash of some sort snip Why are you using a scal

Re: splitting text that contains an encrypted value

2006-04-28 Thread John W. Krahn
Rance Hall wrote: > here is the prelim setup: > > my $delimiter = ";;;"; > my $teststring = "name;;;encryptedpassword;;;date"; > > my @userdetails = split($delimiter, $teststring); > > here is the goal: > > I would like to find a delimiter value that I can use to both create and > read from a f

Re: splitting text that contains an encrypted value

2006-04-28 Thread Mr. Shawn H. Corey
On Fri, 2006-28-04 at 14:16 -0500, Rance Hall wrote: > here is the prelim setup: > > my $delimiter = ";;;"; > my $teststring = "name;;;encryptedpassword;;;date"; > > my @userdetails = split($delimiter, $teststring); > > here is the goal: > > I would like to find a delimiter value that I can use

RE: Splitting on white space

2006-03-15 Thread John Bruin
Thanks very much - I has completely missed whitespace before the slash. John > -Original Message- > From: Timothy Johnson [mailto:[EMAIL PROTECTED] > Sent: 16 March 2006 14:41 > To: John Bruin; beginners@perl.org > Subject: RE: Splitting on white space > > > I

Re: Splitting on white space

2006-03-15 Thread Tom Phoenix
On 3/15/06, John Bruin <[EMAIL PROTECTED]> wrote: > my $string = 'one two threefour'; > my @temp = split(/ \s{1,}/,$string); Your pattern matches a space followed by one or more whitespace characters (such as tab, space, or newline). There's just a single space between "two" and "three", an

RE: Splitting on white space

2006-03-15 Thread Timothy Johnson
It isn't splitting on the 'two three' because it doesn't match. / \s{1,}/ matches a space followed by one or more whitespace characters (you have a space in front of your \s) -Original Message- From: John Bruin [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 15, 2006 5:37 PM To: beg

Re: Splitting file

2006-01-10 Thread Dr.Ruud
Raoul Ripmeester schreef: > How can I make the split to work with one or multiple space. What you aim for, is already the default behaviour of split. perldoc -f split "If PATTERN is also omitted, splits on whitespace (after skipping any leading whitespace). [...] As a special case, specifyin

RE: Splitting file

2006-01-10 Thread Raoul Ripmeester
Ryan, Yes thank you that works and did the trick. Kind regards, Raoul. On Tue, 2006-01-10 at 16:48 -0500, Ryan Frantz wrote: > > > -Original Message- > > From: Raoul Ripmeester [mailto:[EMAIL PROTECTED] > > Sent: Tuesday, January 10, 2006 4:48 PM > > To: beginners@perl.org > > Subject

Re: Splitting file

2006-01-10 Thread Casey Cichon
On Tue, Jan 10, 2006 at 10:47:50PM +0100 or thereabouts, Raoul Ripmeester wrote: > Hello all, > > I am a newbe so please bare with me : > > I am trying to split lines of a file into variables so I can do some > sorting and other stuff with this. Now my script is working but the > split is giving

RE: Splitting file

2006-01-10 Thread Ryan Frantz
> -Original Message- > From: Raoul Ripmeester [mailto:[EMAIL PROTECTED] > Sent: Tuesday, January 10, 2006 4:48 PM > To: beginners@perl.org > Subject: Splitting file > > Hello all, Hello, > > I am a newbe so please bare with me : > > I am trying to split lines of a file into variable

Re: Splitting on =

2005-09-21 Thread Tommy Nordgren
Sep 21, 2005 kl. 9:48 PM skrev Tommy Nordgren: How do you split a string on the equality character? Neither split (/=/,$myvar) nor split ('=',$myvar) appears to work "Home is not where you are born, but where your heart finds peace" - Tommy Nordgren, "The dying old crone" -- To unsubscribe,

Re: Splitting on =

2005-09-21 Thread John W. Krahn
Tommy Nordgren wrote: > > This is my full script: > #!/usr/bin/perl > use strict; > use warnings; > > if ( @ARGV !=2) { > die "Usage: nibfixup Nibfile Applicationname\n" ; > } > > my $nibfile = $ARGV[0]; > my $appname = $ARGV[1]; > > print "Running nibtool\n"; > my $dictionary = `/usr/bin/n

Re: Splitting on =

2005-09-21 Thread Tommy Nordgren
Sep 21, 2005 kl. 9:55 PM skrev Wagner, David --- Senior Programmer Analyst --- WGO: Tommy Nordgren wrote: How do you split a string on the equality character? Neither split (/=/,$myvar) nor split ('=',$myvar) appears to work "Home is not where you are born, but where your heart finds peace

Re: Splitting on =

2005-09-21 Thread John W. Krahn
Tommy Nordgren wrote: > > Sep 21, 2005 kl. 9:54 PM skrev John W. Krahn: > >> Tommy Nordgren wrote: >> >>> How do you split a string on the equality character? >>> Neither split (/=/,$myvar) >>> nor split ('=',$myvar) >>> appears to work >> >> How does it not work? > > When called with the sy

RE: Splitting on =

2005-09-21 Thread Bakken, Luke
Tommy Nordgren wrote: > How do you split a string on the equality character? > Neither split (/=/,$myvar) > nor split ('=',$myvar) > appears to work > "Home is not where you are born, but where your heart finds peace" - > Tommy Nordgren, "The dying old crone" You are doing something incorrectly.

Re: Splitting on =

2005-09-21 Thread Jeff 'japhy' Pinyan
On Sep 21, Tommy Nordgren said: When called with the syntax I've used, it returns a list containing a single string. I'll try without the paranthesis. Can it be that perl treats the entire source text between left and right paranthesis as a regular expression. If so, I consider this a bug.

Re: Splitting on =

2005-09-21 Thread Tommy Nordgren
Sep 21, 2005 kl. 9:54 PM skrev John W. Krahn: Tommy Nordgren wrote: How do you split a string on the equality character? Neither split (/=/,$myvar) nor split ('=',$myvar) appears to work How does it not work? When called with the syntax I've used, it returns a list containing a si

RE: Splitting on =

2005-09-21 Thread Wagner, David --- Senior Programmer Analyst --- WGO
Tommy Nordgren wrote: > How do you split a string on the equality character? > Neither split (/=/,$myvar) > nor split ('=',$myvar) > appears to work > "Home is not where you are born, but where your heart finds peace" - > Tommy Nordgren, "The dying old crone" Really need the context of wha

Re: Splitting on =

2005-09-21 Thread John W. Krahn
Tommy Nordgren wrote: > How do you split a string on the equality character? > Neither split (/=/,$myvar) > nor split ('=',$myvar) > appears to work How does it not work? It works for me. $ perl -le' print for split /=/, "one=two" ' one two John -- use Perl; program fulfillment -- To unsu

Re: splitting data stream

2005-08-18 Thread Jeff 'japhy' Pinyan
On Aug 18, Octavian Rasnita said: I want to use regular expressions (or other techniques) to split a data stream which has the following format: ... The is a 4 digit number and tells the size of the next body it should get. You can roll your own with substr() and what-not, or you can use th

RE: splitting data stream

2005-08-18 Thread Moon, John
From: Octavian Rasnita [mailto:[EMAIL PROTECTED] Sent: Thursday, August 18, 2005 8:04 AM To: beginners perl Subject: splitting data stream Hi, I want to use regular expressions (or other techniques) to split a data stream which has the following format: ... The is a 4 digit number and tells t

Re: splitting based on index

2005-03-10 Thread Gretar M Hreggvidsson
Hi Could you describe a bit more what you are trying to accomplish? Gretar Mar Saurabh Singhvi wrote: hi all if (($pos = index($free,"M",$pos)) > -1) { print "Found at $pos\n"; } now what i want to do is except the part that was found in index should be out

Re: splitting by number

2005-02-18 Thread Doug Essinger-Hileman
On 18 Feb 2005 at 16:12, Ken Gillett wrote: > That's very much what I had in mind, but I couldn't figure how to > automatically set up which remainders go to which HD. I want just the > ratio to be specified and everything else to be calculated. However, I > think I can see how to do that now. >

Re: splitting by number

2005-02-18 Thread Ken Gillett
On 17 Feb 2005, at 21:40, Doug Essinger-Hileman wrote: On 17 Feb 2005 at 11:27, Ken Gillett wrote: Initially the storage requirements are 2:1, so simply dividing the name by 3 would (I think) work, i.e. if the name is exactly divisible by 3 or not could determine in which location to place it. But

Re: splitting by number

2005-02-17 Thread Doug Essinger-Hileman
On 17 Feb 2005 at 11:27, Ken Gillett wrote: > Initially the storage requirements are 2:1, so simply dividing the > name by 3 would (I think) work, i.e. if the name is exactly divisible > by 3 or not could determine in which location to place it. But if I > need to change that to e.g. 3:2 it's not

RE: splitting by number

2005-02-17 Thread Charles K. Clarkson
Ken Gillett <[EMAIL PROTECTED]> wrote: : I have thousands ( <50,000 ) of numerically named files that I : need to store in 2 different location so that the ratio of : numbers of files in each location is maintained at a preset : ratio. The files will be repeatedly created and I want to ensure : th

Re: splitting by number

2005-02-17 Thread bright true
Hi , what i understand from what you wrote ... that you want to check if the files already exits you won't to copy it again so you can check that useing if(-e "location/Filename"){do something } this will return true whenever a file is exits ... if you want to copy whenever a file isn't exi

Re: Splitting large file into little chunks based on tagging (example & script inc.)

2005-01-24 Thread John W. Krahn
FlashMX wrote: Hi, Hello, I have a large file that I want to split into smaller chunks based on a start and end text (...) My script works only partially. It only saves the first occurence of my match and then closes the script. How can I get it to keep ripping throught the file saving into individ

re: Splitting large file into little chunks based on tagging (example & script inc.)

2005-01-24 Thread FlashMX
Hi, I have a large file that I want to split into smaller chunks based on a start and end text (...) My script works only partially. It only saves the first occurence of my match and then closes the script. How can I get it to keep ripping throught the file saving into individual files. My file

RE: Splitting colon delimited file in sub

2004-08-13 Thread Charles K. Clarkson
William Paoli <[EMAIL PROTECTED]> wrote: : What is this doing? Very little. See below. : sub data_file { : open FILE, "colon-delimted.txt"; Always verify I/O operations. my $file = 'colon-delimted.txt'; open FH, $file or die qq(Cannot open "$file": $!); : while ( my $line = ) {

Re: splitting large xml file

2004-07-23 Thread Sean Davis
Rob, Thanks for replying. I ended up answering my own question. I used XML::Twig to find chunks I was interested in, could grab indexing information from the twig, then save the indices in a database for later lookup of the entire XML record and...presto, random-access of 200 Mb of XML! Sean

RE: splitting large xml file

2004-07-22 Thread Hanson, Rob
> Ideally, I would use SAX to parse things Optionally you could look at XML::RAX. Article on the RAX concept: http://www.xml.com/pub/a/2000/04/26/rax/index.html RAX allows you to specify a record seperator (a tag in the XML file), and splits into into chunks of that tag. It is stream based so i

Re: splitting

2004-06-11 Thread Roberto Etcheverry
If you split the line like this: @seqs=split(/gi|37182815|gb|AY358849.1|/,$seq); It means the fields are separated by 'gi' or '37182815' or 'gb' or 'AY358849.1'. I don't think this is what you are looking for... From the previous post, it seems the file is separated by tabs, so 'gi|37182815|gb

Re: splitting

2004-06-11 Thread Anders Holm
Hi Aditi. During the split, what you have specifid is to match: gi OR 37182815 OR gb OR AY358849.1 ... That's what is giving the result you have. I.e. the | means OR in a regexp like the one used in split... Easiest solution is to escape the pipe character, i.e.: @seqs=split(/gi\|37182815\|gb\

Re: splitting

2004-06-11 Thread Randy W. Sims
aditi gupta wrote: hi to all, i have a file $seq, in following format: gi|37182815|gb|AY358849.1| gi|2353725|gb|AF015490.1|AF015490 100.00 16 0 0 544 559 320 335 4.2 32.21 gi|37182815|gb|AY358849.1| gi|1335960|gb|U55203.1|BTU55203 100.00 16 0 0 544 559 380 395 4.2 32.21 gi|37182815|gb|AY35

RE: splitting with special characters

2004-06-03 Thread NYIMI Jose (BMB)
> -Original Message- > From: Singh, Ajit p [mailto:[EMAIL PROTECTED] > Sent: Thursday, June 03, 2004 3:11 PM > To: Singh, Ajit p; [EMAIL PROTECTED] > Subject: splitting with special characters > > > Hello All, > > I am trying to split a string with the / ( forward slash) as > the marke

Re: splitting with special characters

2004-06-03 Thread Mandar Rahurkar
I think whats happening is your printing the entire array @result_from_split...do @result_from_split[0] and so on.. Mandar Original message >Date: Thu, 3 Jun 2004 08:19:45 -0500 >From: James Edward Gray II <[EMAIL PROTECTED]> >Subject: Re: splitting with special c

Re: splitting with special characters

2004-06-03 Thread Ramprasad A Padmanabhan
Works for me #!/usr/bin/perl # # use strict; use Data::Dumper; my $mystring = "abcde/fghi"; my @a = split (/\//,$mystring); print Dumper([EMAIL PROTECTED]); __END__ OUTPUT $VAR1 = [ 'abcde', 'fghi' ]; Ram On Thu, 2004-06-03 at 18:41, Singh, Ajit p wrote: > Hel

RE: splitting with special characters

2004-06-03 Thread Cristi Ocolisan
Hi Singh, Try this: $mystring = "abcde/fghi"; @a = split (/\//, $mystring); print "$a[0]\n"; print "$a[1]"; Regards, Cristi Ocolisan -Original Message- From: Singh, Ajit p [mailto:[EMAIL PROTECTED] Sent: 3 iunie 2004 16:11 To: Singh, Ajit p; [EMAIL PROTECTED] Subject: splitting with

Re: splitting with special characters

2004-06-03 Thread James Edward Gray II
On Jun 3, 2004, at 8:11 AM, Singh, Ajit p wrote: Hello All, I am trying to split a string with the / ( forward slash) as the marker. $mystring = "abcde/fghi" split (///,$mystring) -- gives me compile error split (/\//,$mystring) -- gives me abcdefghi I hope not. The second one is fine: > perl

Re: Splitting html into body and header...

2004-02-25 Thread juman
Okay.. cpan.org here I come :) /juman On Wed, Feb 25, 2004 at 05:47:18PM -0500, Casey West wrote: > HTML::TreeBuilder is a good module to look at. > > Casey West -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: Splitting html into body and header...

2004-02-25 Thread Casey West
It was Wednesday, February 25, 2004 when David O'Dell took the soap box, saying: : juman wrote: : >Does anyoen have a good tip if there is a module or good way to split a : >html file inte header and body? What I want to do is to combine several : >htmlfiles into one. And the idea is to remove all

Re: Splitting html into body and header...

2004-02-25 Thread David O'Dell
juman wrote: Does anyoen have a good tip if there is a module or good way to split a html file inte header and body? What I want to do is to combine several htmlfiles into one. And the idea is to remove all headers from all the files and combine the bodys into a big new one with a new header... /ju

Re: splitting / unpacking line into array

2004-02-03 Thread Wiggins d'Anconia
John McKown wrote: On Mon, 2 Feb 2004, Wiggins d Anconia wrote: Sounds pretty good to me. One concern, do the sub record types always have the same number of fields? Using your array to unpack into may turn into a maintenance nightmare with respect to indexing into it to get values if the recor

Re: splitting / unpacking line into array

2004-02-02 Thread John McKown
On Mon, 2 Feb 2004, Wiggins d Anconia wrote: > > Sounds pretty good to me. One concern, do the sub record types always > have the same number of fields? Using your array to unpack into may > turn into a maintenance nightmare with respect to indexing into it to > get values if the record formats

Re: splitting / unpacking line into array

2004-02-02 Thread Wiggins d Anconia
> I have an input file which has many subrecords. The subrecord type is > denoted by the first 4 characters of the file. The rest of the line is > formatted like similar to the way that "pack" would format one. That is, > each data point in a subtype is always at the same offset for the same >

Re: Splitting Comma delimited list

2003-12-29 Thread Colin Johnstone
tralia/Contr/[EMAIL PROTECTED] cc: <[EMAIL PROTECTED]> Subject:Re: Splitting Comma delimited list Colin Johnstone wrote: > Bob, > > The cms makes those changes. It also inserts comments as shown below > which > aren't in my code and wraps it all

Re: Splitting Comma delimited list

2003-12-29 Thread Bob Showalter
Colin Johnstone wrote: > Bob, > > The cms makes those changes. It also inserts comments as shown below > which > aren't in my code and wraps it all in the select tags. A suggestion: Post a message with the input data, the script, and the actual output produced *by that script*. Put the input data

RE: Splitting Comma delimited list

2003-12-29 Thread Colin Johnstone
IL PROTECTED]> 30/12/2003 09:23 AM To: Colin Johnstone/Australia/Contr/[EMAIL PROTECTED] cc: [EMAIL PROTECTED] Subject: RE: Splitting Comma delimited list Colin Johnstone wrote: > Hi All, > > I have nothing to gain by not showing you all my

RE: Splitting Comma delimited list

2003-12-29 Thread Bob Showalter
Colin Johnstone wrote: > Hi All, > > I have nothing to gain by not showing you all my code, I have > included all suggested changes and even am writing to the select list > the > number of > elements. note the second item. > > here is my code again with the changes and the output below, note the

RE: Splitting Comma delimited list

2003-12-29 Thread Colin Johnstone
Transactional When Life Changes Workplace Practices "Tim Johnson" <[EMAIL PROTECTED]> 30/12/2003 08:49 AM To: Colin Johnstone/Australia/Contr/[EMAIL PROTECTED], "James Edward Gray II" <[EMAIL PROTECTED]> cc: <[EMAIL PROTECTE

RE: Splitting Comma delimited list

2003-12-29 Thread Tim Johnson
t and assigning it to a variable twice by accident so that one result gets thrown away, or something along those lines. -Original Message- From: Colin Johnstone [mailto:[EMAIL PROTECTED] Sent: Monday, December 29, 2003 1:40 PM To: James Edward Gray II Cc: [EMAIL PROTECTED] Subject: Re: Spli

Re: Splitting Comma delimited list

2003-12-29 Thread James Edward Gray II
On Dec 29, 2003, at 3:40 PM, Colin Johnstone wrote: Hi James, Thanks for the tips, I took your advice here is the HTML returned, There still isn't the full 43 elements though strange? So you obviously sent us: A. Different Data or B. Different Code. Right? ;) That might put us at a slight

Re: Splitting Comma delimited list

2003-12-29 Thread Colin Johnstone
03 08:26 AM To: Colin Johnstone/Australia/Contr/[EMAIL PROTECTED] cc: [EMAIL PROTECTED] Subject: Re: Splitting Comma delimited list On Dec 29, 2003, at 3:12 PM, Colin Johnstone wrote: > Hello everyone, > > I use the following to split a comma delimited

Re: Splitting Comma delimited list

2003-12-29 Thread James Edward Gray II
On Dec 29, 2003, at 3:12 PM, Colin Johnstone wrote: Hello everyone, I use the following to split a comma delimited list and get varying results and I don't understand why. Running your code on your data, I get the expected results (43). my count of the elements in the splitdata array returns 43

RE: splitting a string

2003-12-10 Thread Tim Johnson
For those of you that are interested, I benchmarked a few of the suggestions. Drieux is by a significant margin the winner speed-wise. What I did was split the scalar into an array and then define the four variables by join()ing the result using an array slice instead of making a new array. Runn

RE: splitting a string

2003-12-10 Thread Wagner, David --- Senior Programmer Analyst --- WGO
Ravi Malghan wrote: > Hi: I want to split the string > 0.0.0.0.1.10.1.30.1.10.1.30.1 > > into 4 variables: 0.0.0.0, 1, 10.1.30.1 and 10.1.30.1 > > any suggestions? > > TIA > ravi Here is one approach: #!perl -w use strict $_ = '0.0.0.0.1.10.1.30.1.10.1.30.1'; my @MyWorka = (); @MyWorka = spl

Re: splitting a string

2003-12-10 Thread drieux
On Dec 10, 2003, at 4:49 PM, Ravi Malghan wrote: Hi: I want to split the string 0.0.0.0.1.10.1.30.1.10.1.30.1 into 4 variables: 0.0.0.0, 1, 10.1.30.1 and 10.1.30.1 any suggestions? yes, get better data. a part of the problem you have is the that you could do this with a regEx my $input =

Re: Splitting OR Regex

2003-11-07 Thread Rob Dixon
R. Joseph Newton wrote: > > Rob Dixon wrote: > > > my @fields = $string =~ m/\w+=(?:"[^"]+"|\S+)/g; > > Nice!! Thanks! Rob -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: Splitting OR Regex

2003-11-06 Thread R. Joseph Newton
Rob Dixon wrote: > my @fields = $string =~ m/\w+=(?:"[^"]+"|\S+)/g; Nice!! Joseph -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: Splitting OR Regex

2003-10-31 Thread Rob Dixon
Joshua Scott wrote: > > How can I split the data in a line by a single whitespace but also keep > portions between quotes together? Here is an example of a line of data I'm > trying to parse: > > id=firewall time="2003-10-30 04:15:01" fw=66.74.67.229 pri=5 c=256 m=38 > msg="ICMP packet dropped" n=

Re: Splitting OR Regex

2003-10-31 Thread Tore Aursand
On Thu, 30 Oct 2003 23:37:55 -0500, Scott, Joshua wrote: > How can I split the data in a line by a single whitespace but also keep > portions between quotes together? This is a FAQ: perldoc -q delimit -- Tore Aursand <[EMAIL PROTECTED]> -- To unsubscribe, e-mail: [EMAIL PROTECTED] For add

Re: Splitting a path

2003-08-04 Thread Steve Grazzini
On Mon, Aug 04, 2003 at 02:00:03PM -0700, Gupta, Sharad wrote: > I may be missing something, but the doc for ENV says: > > " Arrays are implemented in terms of split and join, > using $Config::Config{path_sep} as the delimiter. " > > Now if i split this: > > Foo = C:\foo\bar:D:\foo\bar > > usi

  1   2   >