[Perl] merge DB problem

Yossi.Itzkovich at lightscapenet.com Yossi.Itzkovich at lightscapenet.com
Tue Oct 22 22:58:21 PDT 2002


no. any string is valid.

Yossi



                                                                                                                                 
                      Shlomo Yona                                                                                                
                      <shlomo at cs.haifa         To:      perl at perl.org.il                                                         
                      .ac.il>                  cc:                                                                               
                      Sent by:                 Subject: Re: [Perl] merge DB problem                                              
                      perl-admin at perl.                                                                                           
                      org.il                                                                                                     
                                                                                                                                 
                                                                                                                                 
                      10/23/2002 09:42                                                                                           
                      Please respond                                                                                             
                      to perl                                                                                                    
                                                                                                                                 
                                                                                                                                 



Hello.

Your data always looks like
/[a-z][a-z]/
(e.g. aa or bb etc.)?

--
Shlomo Yona
shlomo at cs.haifa.ac.il
http://cs.haifa.ac.il/~shlomo/
On Wed, 23 Oct 2002 Yossi.Itzkovich at lightscapenet.com wrote:

> I have two files with many records with the format  of :
>
> Name N
> valLine#1
> valLine#2
> ...
> valLine#N
>
>
> N indicates how many following lines this records has.
>
> I need to merge 2 such files, which is prety simple using 2 hashes,  but
I
> want to add records from file1 (that are missing in file2) in the same
> order/position to file2.
>
> For example:
>
> File1 is:
> a 2
> aa
> aa
> b 1
> bb
> c 1
> cc
>
> File 2 is:
> a 2
> aa
> aa
> c 1
> cc
> d 1
> dd
>
>
> I want record "b" from file 1 to be added after record "a".  How can I
> change the original solution (using 2 hashes and merge and checking
> existance of keys) to suit this one too? I need a simple solution as
> possible.

_______________________________________________
Perl mailing list
Perl at perl.org.il
http://www.perl.org.il/cgi/listinfo/perl







More information about the Perl mailing list