ronan76 has asked for the wisdom of the Perl Monks concerning the following question:

This node falls below the community's minimum standard of quality and will not be displayed.
  • Comment on CGI script to read CSV file and modify for web output

Replies are listed 'Best First'.
Re: Urgent help required
by demerphq (Chancellor) on Oct 18, 2002 at 11:05 UTC
    With all due respect, you node probably got deleted because it shows no effort. We the readers of this site arent here to write adhoc scripts for people. We are here to help each other solve our perl problems to learn learn learn.

    Now, if you want you can go and buy a book called Perl Cookbook and look up the various solutions to your different issues, then merge them into a single script and use that. You could even post the script you've put together and ask for help with it.

    Until you post code and ask some specific questions I suspect that you wont get much help at this site.

    Oh, a title like "urgent help needed" is also a really good way to piss the regulars off. Try being a bit more specific, and also try to remember that nobody here is paid to do anything, so whats urgent to you, isnt urgent to us. To be honest im a touch suprised that this needs to be said in the first place.

    --- demerphq
    my friends call me, usually because I'm late....

    A reply falls below the community's threshold of quality. You may see it by logging in.
Re: Urgent help required
by nothingmuch (Priest) on Oct 18, 2002 at 11:13 UTC
    You probably want to look into the DBI and DBD::CSV modules, which provide an interface. translation of pseudocode:
    use Fcntl qw(LOCK_EX LOCK_UN); my $header = 'foo'; my $footer = 'bar'; my $prefix = 'baz'; open CSV,$csvfile; open OUTPUT,">$header"; flock OUTPUT,LOCK_EX; $, = ","; # output field seperator, joins lists passed to print while (<CSV>){ print OUTPUT $prefix,$_; # no need to split; # just so you know : @list = split(/,/,$_); # will do the trick better than $var1,$var2... # but you want to chomp($_) first, and set $\ to "\n" perh +aps # then you print OUTPUT $prefix,@list # and CSV is done for you. } print OUTPUT $footer; flock OUPTUT,LOCK_UN; # not really needed, i think close OUTPUT; close CSV;


    -nuffin
    zz zZ Z Z #!perl
      Thanks, i appreciate your help and time ronan