http://www.perlmonks.org?node_id=951161


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

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.