hi again, i've got some problems using your script:
best is if i give you the three files so here they are file1 should be merged in file2 but file2 should have the same layout as befor merging christophe folschette Rob wrote: > Christophe > > I think using Tie::File is overkill here. Try this: > > # Merge the two files into a single hash > # > for $file ( 'file2.dat', 'file1.dat' ) > { > open FILE, "< $file"; > > while ( <FILE> ) > { > chomp; > ($key, $val) = split /:\s+/; > $data{$key} = $val; > } > > close FILE; > } > > # and splat it out again > # > open FILE, "> file3.dat"; > printf FILE "%s: %s\n", $_, $data{$_} > for (sort keys %data); > close FILE; > > I'm not sure about your 'some text'. If you're allowing comment lines > starting with a hash then > > next if /^#/; > > at the start of the inner loop will do. Now if you want the comments > retaining, that's another matter :)) > > I never like posting just a solution on the beginners' group, but I don't > think I'm doing anything obscure here that needs explaining. Tell me if > I'm wrong. > > HTH. > > Cheers, > > Rob > > ----- Original Message ----- > From: "folschette" <[EMAIL PROTECTED]> > To: <[EMAIL PROTECTED]> > Sent: Tuesday, October 15, 2002 10:56 AM > Subject: file to file copy > > >> hello, >> i have to write a perl script which copies text from one file to another > but >> only if the text is not exisiting yet. >> For example: >> in file1: >> word: moon >> word2: sky >> ... >> the same syntax for every line >> >> in file2: >> #some text >> word: honey >> word3: lol >> word4: mu >> ... >> as well the same syntax for every line >> >> so now i want to merge file1 into file2, so that word: honey will be >> replaced by word: moon and word2: sky will be appended to file2. >> i have written the following script but i've got little problem with it, > can >> someone help me? or test it? >> >> thanx, christophe folschette > > > ---------------------------------------------------------------------------- > ---- > > >> -- >> To unsubscribe, e-mail: [EMAIL PROTECTED] >> For additional commands, e-mail: [EMAIL PROTECTED]
start_url: http://www.google.com common_dir: /search/common database_dir: /search/db config_dir: /search/conf
limit_urls_to: ${start_url} exclude_urls: /cgi-bin/ .cgi bad_extensions: .wav .gz .z .sit .au .zip .tar .hqx .exe .com .gif \ .jpg .jpeg .aiff .class .map .ram .tgz .bin .rpm .mpg .mov .avi # The excerpts that are displayed in long results rely on stored information # in the index databases. The compiled default only stores 512 characters of # text from each document (this excludes any HTML markup...) If you plan on # using the excerpts you probably want to make this larger. The only concern # here is that more disk space is going to be needed to store the additional # information. Since disk space is cheap (! :-)) you might want to set this # to a value so that a large percentage of the documents that you are going # to be indexing are stored completely in the database. At SDSU we found # that by setting this value to about 50k the index would get 97% of all # documents completely and only 3% was cut off at 50k. You probably want to # experiment with this value. # Note that if you want to set this value low, you probably want to set the # excerpt_show_top attribute to false so that the top excerpt_length characters # of the document are always shown. # max_head_length: 75000 # The following are used to change the text for the page index. # The defaults are just boring text numbers. These images spice # up the result pages quite a bit. (Feel free to do whatever, though) # next_page_text: prochaine page no_next_page_text: prev_page_text: page précédente no_prev_page_text: page_number_text: "1" \ "2" \ "3" \ "4" \ "5" \ "6" \ "7" \ "8" \ "9" \ "10" # # To make the current page stand out, we will put a border arround the # image for that page. # no_page_number_text: "<b>1</b>" \ "<b>2</b>" \ "<b>3</b>" \ "<b>4</b>" \ "<b>5</b>" \ "<b>6</b>" \ "<b>7</b>" \ "<b>8</b>" \ "<b>9</b>" \ "<b>10</b>" #LENGTH OF THE EXCERPT excerpt_length: 500 #if the searched word isn't found in the document itself, the beginning of the document is shown if excerpt_show_top: yes excerpt_show_top: no #wann dat gesichtent wuert net fonnt get dann get keen excerpt ugewisen #no_excerpt_text: Le mot que vous aviez recherché ne peut pas être trouvé en tant que tel dans ce document mais par exemple si vous aviez recherché le mot #'tabac', il se peut que le mot 'tabacs' a été trouvé dans le document en question. minimum_word_length: 2 maximum_pages: 20 maximum_page_buttons: 20 case_sensitive: true #This value determines the maximum number of excerpts that can be displayed for one matching document in the search results. max_excerpts: 3 database_dir: /
-- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]