hello everybody,
first of all i'd like to thank all of you for your time and help.. but i'm
still stuck!!
The code which Dave sent:
my @blocks = ();
my $maxlen = 0;
while (DATA) {
chomp;
if (/^#/) {
push @blocks, [];
} elsif ($_) {
push @{$blocks[$#blocks]}, $_;
my $len =
Aditi Gupta wrote:
On 6/23/05, John W. Krahn [EMAIL PROTECTED] wrote:
Aditi Gupta wrote:
I have a file as follows:
#block1
aaa
aaa
#block2
bbb
bbb
#block3
ccc
ccc
and i want to append(or i should say merge) these blocks and get a file
like this:
aaabbbccc
aaabbbccc
how can this be
Aditi Gupta wrote:
Hi Perlers,
Hello,
I have a file as follows:
#block1
aaa
aaa
#block2
bbb
bbb
#block3
ccc
ccc
and i want to append(or i should say merge) these blocks and get a file like
this:
aaabbbccc
aaabbbccc
how can this be done using perl?
please help..
$ echo
aaa
aaa
Hi Perlers,
I have a file as follows:
#block1
aaa
aaa
#block2
bbb
bbb
#block3
ccc
ccc
and i want to append(or i should say merge) these blocks and get a file like
this:
aaabbbccc
aaabbbccc
how can this be done using perl?
please help..
regards
Aditi
Aditi Gupta wrote:
Hi Perlers,
I have a file as follows:
#block1
aaa
aaa
#block2
bbb
bbb
#block3
ccc
ccc
and i want to append(or i should say merge) these blocks and get a
file like this:
aaabbbccc
aaabbbccc
how can this be done using perl?
please help..
regards
Hi all,
I know the terms of the list.. and before this i have always written a code
and asked for a doubt if it doesn't work... but this time i'm not aware of
any way to do the job.. thats why i asked to help me out, I haven't asked
for any code, just hints what can be used. I'm sorry if i
HI Dan,
Since i'm using activestate perl on windows xp i don't know whether paste
will work or not.
I'll try the hash of array.
Thanks for the help
regards
Aditi.
On 6/22/05, Dan Klose [EMAIL PROTECTED] wrote:
If I was doing this I would split the file on the gaps between blocks
and the
On 6/22/05, Aditi Gupta [EMAIL PROTECTED] wrote:
Since i'm using activestate perl on windows xp i don't know whether paste
will work or not.
I'll try the hash of array.
Using a hash of arrays will not necessarily preserve the order. Below
is the start of an array of arrays solution. I'll leave
Using a hash of arrays will not necessarily preserve the order...
If you don't want to worry about sorting the order of the blocks i.e.
doing it yourself then use Tie::IXhash (something like that on CPAN) to
preserve the order, you then don't have to worry about unbalanced blocks
and reassembly
On 6/22/05, Dan Klose [EMAIL PROTECTED] wrote:
Using a hash of arrays will not necessarily preserve the order...
If you don't want to worry about sorting the order of the blocks i.e.
doing it yourself then use Tie::IXhash (something like that on CPAN) to
preserve the order, you then don't
and i want to append(or i should say merge) these blocks and get a
file like this:
aaabbbccc
aaabbbccc
I've asked the same question some time ago,
check this out:
11 matches
Mail list logo