There's enough code here that I'm not even going to try. However, your data
looks almost like json (minus the quoting). If this is the case, you'll
probably want to build up an array of hashes and use JSON::XS.
On Jul 13, 2013 6:16 AM, "Rob Dixon" wrote:
> On 12/07/2013 12:44, Agnello George wrot
On 12/07/2013 12:44, Agnello George wrote:
hi
i have raw data that is like this in a flat file .
start
name:agnello
dob:2 april
address:123 street
end
start
name:babit
dob:13 april
address:3 street
end
start
name:ganesh
dob:1 april
address:23 street
end
i need to get the data in the following
On 07/13/2013 02:55 AM, John Delacour wrote:
#!/usr/bin/perl
use strict;
my @items;
while (<>) { # or use a file handle
chomp;
next if /^start/;
if (/^end/) {
print join ", ", @items;
print "\n";
undef @items;
that is the wrong way to clear an array (o
On 12/7/13 at 17:35, rvtol+use...@isolution.nl (Dr.Ruud) wrote:
perl -0 -wple 's/^start\n(.*?)\nend\n/$_=$1;y{\n}{ };"$_\n"/emgs'
Pure obfuscation! Why not keep things simple?! These stupid
one-liners are a pain in the brain.
#!/usr/bin/perl
use strict;
my @items;
while (<>) { # or use a
gift to you. What you do with it is your gift back to God.
---
From: Agnello George
To: Perl Beginners
Sent: Friday, 12 July 2013 5:14 PM
Subject: grab pattern from start and end block
#!/usr/bin/perl
use Modern::Perl '2011';
use autodie;
my @a;
while( <> ) {
chomp;
my @temp if /^start$/;
if( /^end$/ ) {
push @a, [ @temp ];
} else {
push @temp, $_;
}
}
for my $name ( @a ) {
say join ", ", @$name;
}
On Fri, Jul 12, 2013 at 8:39 PM, John
Dr.Ruud wrote:
On 12/07/2013 13:44, Agnello George wrote:
hi
i have raw data that is like this in a flat file .
start
name:agnello
dob:2 april
address:123 street
end
start
name:babit
dob:13 april
address:3 street
end
start
name:ganesh
dob:1 april
address:23 street
end
i need to get the data
> On 12/07/2013 20:19, Nathan Hilterbrand wrote:
>>> On 12/07/2013 13:44, Agnello George wrote:
>
i have raw data that is like this in a flat file .
start
name:agnello
dob:2 april
address:123 street
end
start
name:babit
dob:13 april
address
On 12/07/2013 20:19, Nathan Hilterbrand wrote:
On 12/07/2013 13:44, Agnello George wrote:
i have raw data that is like this in a flat file .
start
name:agnello
dob:2 april
address:123 street
end
start
name:babit
dob:13 april
address:3 street
end
start
name:ganesh
dob:1 april
address:23 street
> On 12/07/2013 13:44, Agnello George wrote:
>> hi
>>
>> i have raw data that is like this in a flat file .
>>
>> start
>> name:agnello
>> dob:2 april
>> address:123 street
>> end
>> start
>> name:babit
>> dob:13 april
>> address:3 street
>> end
>> start
>> name:ganesh
>> dob:1 april
>> address
On 12/07/2013 13:44, Agnello George wrote:
hi
i have raw data that is like this in a flat file .
start
name:agnello
dob:2 april
address:123 street
end
start
name:babit
dob:13 april
address:3 street
end
start
name:ganesh
dob:1 april
address:23 street
end
i need to get the data in the following
TMTOWTDI
On Fri, Jul 12, 2013 at 7:03 AM, Shawn H Corey wrote:
> On Fri, 12 Jul 2013 17:14:42 +0530
> Agnello George wrote:
>
> > i have raw data that is like this in a flat file .
> >
> > start
> > name:agnello
> > dob:2 april
> > address:123 street
> > end
> > start
> > name:babit
> > dob:13
Agnello George wrote:
hi
Hello,
i have raw data that is like this in a flat file .
start
name:agnello
dob:2 april
address:123 street
end
start
name:babit
dob:13 april
address:3 street
end
start
name:ganesh
dob:1 april
address:23 street
end
i need to get the data in the following format
na
On 12/07/2013 13:56, Shawn H Corey wrote:
On Fri, 12 Jul 2013 13:51:01 +0100
Rob Dixon wrote:
On 12/07/2013 13:30, Agnello George wrote:
could i use local $/ instead of $INPUT_RECORD_SEPARATOR
Yes, and you should do that. The extended variable names are almost
never used and will mostl
On Fri, 12 Jul 2013 13:51:01 +0100
Rob Dixon wrote:
> On 12/07/2013 13:30, Agnello George wrote:
> >
> > could i use local $/ instead of $INPUT_RECORD_SEPARATOR
>
> Yes, and you should do that. The extended variable names are almost
> never used and will mostly confuse people familiar with
On 12/07/2013 13:30, Agnello George wrote:
could i use local $/ instead of $INPUT_RECORD_SEPARATOR
Yes, and you should do that. The extended variable names are almost
never used and will mostly confuse people familiar with Perl.
Rob
--
To unsubscribe, e-mail: beginners-unsubscr...@per
On 12/07/2013 12:44, Agnello George wrote:
hi
i have raw data that is like this in a flat file .
start
name:agnello
dob:2 april
address:123 street
end
start
name:babit
dob:13 april
address:3 street
end
start
name:ganesh
dob:1 april
address:23 street
end
i need to get the data in the following
could i use local $/ instead of $INPUT_RECORD_SEPARATOR
On Fri, Jul 12, 2013 at 5:33 PM, Shawn H Corey wrote:
> On Fri, 12 Jul 2013 17:14:42 +0530
> Agnello George wrote:
>
> > i have raw data that is like this in a flat file .
> >
> > start
> > name:agnello
> > dob:2 april
> > address:123
On Fri, 12 Jul 2013 17:14:42 +0530
Agnello George wrote:
> i have raw data that is like this in a flat file .
>
> start
> name:agnello
> dob:2 april
> address:123 street
> end
> start
> name:babit
> dob:13 april
> address:3 street
> end
> start
> name:ganesh
> dob:1 april
> address:23 street
> e
hi
i have raw data that is like this in a flat file .
start
name:agnello
dob:2 april
address:123 street
end
start
name:babit
dob:13 april
address:3 street
end
start
name:ganesh
dob:1 april
address:23 street
end
i need to get the data in the following format
name:agnello, dob:23 april ,address:
20 matches
Mail list logo