Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re^2: fetching and storing data from web.

by nicolethomson (Initiate)
on Feb 01, 2012 at 09:45 UTC ( #951161=note: print w/ replies, xml ) Need Help??


in reply to Re: fetching and storing data from web.
in thread fetching and storing data from web.

Thanks everyone

partially i am doing things with awk/sed and bash commands ofcourse google did helped #sed -n -e 's/^[ ]*//g'  -e  's/\([0-9a-zA-Z\.]*\)  */\1 /g' -e 10p -e 15p -e 23p nic.htm > nic.txt  then i tried #perl -ne 'print;' *.txt > all.csv, but the result was not comfortable, then i tried with #for file in *.txt; do   cat "$file";   echo; done > newfile.csv  now .csv or .txt file gives me the result in readable format  from this text file, need to send it to database
DISTRICT : ZUNHEBOTO STATE : ABC 02/02 03/02 04/02 05/02 06/02 speed 004 002 004 004 004... next line will be next paragraph
DISTRICT : YUNHEBOOT STATE : EFG 02/02 03/02 04/02 05/02 06/02 speed 004 002 004 004 004
 is the result when i do cat of the same, in db i have created table and fields are STATE, District,date, speed  how to import it to db perl -MCPAN -e shell  and did the installation of HTML::PArser, for mysql what else i needto install here


Comment on Re^2: fetching and storing data from web.
Select or Download Code
Replies are listed 'Best First'.
Re^3: fetching and storing data from web.
by tospo (Hermit) on Feb 02, 2012 at 09:14 UTC
    what exactly are you trying to achieve with
    perl -ne 'print;' *.txt > all.csv
    or
    for file in *.txt; do cat "$file"; echo; done > newfile.csv
    ??? Those are a bit pointless, just concatenating files into another file, same as just doing
    cat *.txt > newfile.txt
    And these are not magically creating csv format for you - it's just the same text as in the input files. No idea what you mean with "how to import it to db perl -MCPAN -e shell"???
      <code> true tospo >/code> taking time to learn things, might be a kid's level code i did.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://951161]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (9)
As of 2015-07-29 23:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (269 votes), past polls