Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number

Re: file merge with config(parameter) files

by moritz (Cardinal)
on Mar 02, 2013 at 13:47 UTC ( #1021413=note: print w/replies, xml ) Need Help??

in reply to file merge with config(parameter) files

due to this, need your help whether we can use perl (using hash) for merging files or using sql database (pl sql) to make it faster.

It should be quite possible to do it perl. Keep the config file and the relevant parts of the smaller file (file2) in memory, and process the larger file (file1) line by line.

Of course you can do it in SQL too. If the records already exists in a database, that's probably a simpler approach. If not, importing it likely takes as long as doing the whole processing in Perl.

  • Comment on Re: file merge with config(parameter) files

Replies are listed 'Best First'.
Re^2: file merge with config(parameter) files
by hyans.milis (Novice) on Mar 02, 2013 at 15:07 UTC

    Hi Moritz,

    my idea is to process 1st file line by line. may i know what's the meaning to store the smaller file (file2) in memory ?is there any sample about this? bcoz i'm newbie in perl. thanks

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1021413]
[Corion]: marto: That would be cool :) There is no kids care at Perly events unfortunately, so it's not entirely family friendly
[Corion]: I think I should define a set of (say) five projects through which I rotate from time to time, just to prevent myself from being bored/annoyed by the problems they get stuck in ;)
[marto]: Corion, not bringing the kids would make it ideal :P
[marto]: a suggestion, have one project in the list that isn't programming/perl related
[Corion]: marto: Yeah, things are more parent-friendly the way they are ;))
[marto]: some hardware/makey thing
[Corion]: marto: Ah, I'm currently drifting to that again, over"painting" (well with Inkscape) one of my photographs and thinking about vectorizing some other images ...
[marto]: Corion, yes something 'artistic', so that or some music. Even combine some things, build a musical instrument :)
[Corion]: marto: Naah, I'm avoiding that rabbit hole ;) Sometimes I think of using Perl to create MIDI to generate music, or at least the harmonies to which I could jam, but then that would eat even more into available time ;-))

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (5)
As of 2017-07-27 07:45 GMT
Find Nodes?
    Voting Booth?
    I came, I saw, I ...

    Results (404 votes). Check out past polls.