in reply to Reading files and importing data to database

I think I understand what you want to achieve, but what exactly is your question? I.e. which part of this task do you have problems with? Also (just for curiosity): Is it really necessary that you first export it to CSV, or is it also an option that you directly write it to the database (which would seem more natural to me, unless you need the CSV file for anything else)? Using a CSV file to contain only 1 value seems to be a bit of an overkill...

-- 
Ronald Fischer <ynnor@mm.st>

Replies are listed 'Best First'.
Re^2: Reading files and importing data to database
by Anonymous Monk on Jun 22, 2009 at 08:34 UTC
    My question would be can you help me with the code (if it possible all of it) , how to do that stuff.. and yes it would be option to write directly to database but with that is kinda tricky, becouse the table where we suppose to import that value doesn't have a columm with value T as a temperature so it will need to create that to..
      My question would be can you help me with the code (if it possible all of it)

      While you will get for sure help on concrete programming questions, I'm a bit puzzled why you didn't present already part of the code you already have written. May I ask you your background as a programmer? I assume that you already have programming experience in some other programming language (otherwise I don't think someone would have asked you to do such a task), but how is your Perl experience? In case you have never written a Perl program at all, I strongly suggest to spend at least 1-2 days learning the basics of Perl before starting on a real-world problem.

      the table where we suppose to import that value doesn't have a columm with value T as a temperature so it will need to create that to.

      Aside from the fact that, as you can do a SQL insert statement from Perl, you can do equally well do a SQL modify table statement from Perl, do you really want to create a new column every time the program is run???? Usually, the table is created beforehand (which you can conveniently do outside of Perl), so I still don't see the advantage of having a CSV file.

      -- 
      Ronald Fischer <ynnor@mm.st>

      This site is not a program writing service. We will help you if you have specific problems with your existing program, and we will advise you on how to best approach different problems, but we will not write complete programs for you. You have to be(come) a programmer to participate here.