[26777] in Perl-Users-Digest
Perl-Users Digest, Issue: 8844 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Jan 9 18:05:36 2006
Date: Mon, 9 Jan 2006 15:05:09 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Mon, 9 Jan 2006 Volume: 10 Number: 8844
Today's topics:
How to convert MetaStock formatted files into ASCII fil <a@yahoo.com>
Re: How to convert MetaStock formatted files into ASCII <ronrosenfeld@nospam.org>
in ed(1) one can do s///n <jidanni@jidanni.org>
Uploading 2 files with 1 CGI buffer <wh2leung@student.cs.uwaterloo.ca>
Re: Uploading 2 files with 1 CGI buffer xhoster@gmail.com
Re: Uploading 2 files with 1 CGI buffer <noreply@gunnar.cc>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Mon, 09 Jan 2006 20:02:13 GMT
From: Steve D <a@yahoo.com>
Subject: How to convert MetaStock formatted files into ASCII files
Message-Id: <i7g5s1h845ps4k6tql79kb35m3evo5afft@4ax.com>
I have searched everywhere for information on how to convert MetaStock
formatted files into ASCII files. MetaStock files are used by various
financial charting apps - and I have a lot of these files that I need
to convert into csv files. Any help would be appreciated (I am under a
lot of time pressure here and would be willing to pay for this help -
if needed). Thanks in advance.
------------------------------
Date: Mon, 09 Jan 2006 17:37:01 -0500
From: Ron Rosenfeld <ronrosenfeld@nospam.org>
Subject: Re: How to convert MetaStock formatted files into ASCII files
Message-Id: <8bp5s1d2da8q7n8pqphmo26qlg3gsukqpk@4ax.com>
If you have Downloader from Equis (it used to be available at no charge but
I haven't checked lately), conversion routines are built-in.
--ron
------------------------------
Date: Mon, 9 Jan 2006 21:09:50 +0000 (UTC)
From: Dan Jacobson <jidanni@jidanni.org>
Subject: in ed(1) one can do s///n
Message-Id: <87ace58iot.fsf@jidanni.org>
How can one live without little old ed(1)'s s///n?
(.,.)s/re/replacement/n
The `n' suffix, where n is a postive number, causes only the nth
match to be replaced.
s/a/A/13p
aaaaaaaaaaaaAaaaaaaa
How can one do s///n in perl without jumping through hoops?
------------------------------
Date: Mon, 9 Jan 2006 15:42:22 -0500
From: William <wh2leung@student.cs.uwaterloo.ca>
Subject: Uploading 2 files with 1 CGI buffer
Message-Id: <Pine.GSO.4.64.0601091540440.13735@cpu02.student.cs.uwaterloo.ca>
Code in question:
#!/usr/bin/perl -w
use strict;
my $tempfile;
my $upath;
my $savedfilename;
# The following reads in the CGI buffer, and writes it to a temporary file
# which will used later.
read ( STDIN, my $buffer, $ENV{'CONTENT_LENGTH'} );
open ( TEMP_FD,">$tempfile" );
print TEMP_FD $buffer;
close ( TEMP_FD );
open ( TEMPFILE_FD, $tempfile );
# Gotta pull the MIME/multipart separator line out
$_ = <TEMPFILE_FD>; (
my $vernum) = /(\d+)/;
$_ = <TEMPFILE_FD>;
my $filetemp = $1 if (/filename=\"(.*)\"/);
#create the output file in the upload directory
open ( OUTFILE_FD, ">$upath$savedfilename");
close ( TEMPFILE_FD );
close ( OUTFILE_FD );
Question: my above code only uploads 1 file. How do I upload 2 files
simulataenously with the same CGI buffer?
P.S. this script is run from a website with 2 "Browse..." for file
widgets.
------------------------------
Date: 09 Jan 2006 20:58:08 GMT
From: xhoster@gmail.com
Subject: Re: Uploading 2 files with 1 CGI buffer
Message-Id: <20060109155808.600$72@newsreader.com>
William <wh2leung@student.cs.uwaterloo.ca> wrote:
> Code in question:
...
>
> Question: my above code only uploads 1 file. How do I upload 2 files
> simulataenously with the same CGI buffer?
I would use the module CGI.pm to do it. If I couldn't use CGI.pm for some
bizarre reason, then I would look at the source code for CGI.pm, mostly in
the subroutine "read_multipart", and use that as a starting point.
Xho
--
-------------------- http://NewsReader.Com/ --------------------
Usenet Newsgroup Service $9.95/Month 30GB
------------------------------
Date: Mon, 09 Jan 2006 22:44:05 +0100
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: Uploading 2 files with 1 CGI buffer
Message-Id: <42g3p5F1hop38U1@individual.net>
xhoster@gmail.com wrote:
> William <wh2leung@student.cs.uwaterloo.ca> wrote:
>>How do I upload 2 files simulataenously with the same CGI buffer?
>
> I would use the module CGI.pm to do it.
And I would use CGI::UploadEasy (which, in turn, makes use of CGI.pm).
#!/usr/bin/perl -T
use strict;
use warnings;
use CGI::UploadEasy;
use Data::Dumper;
my $uploaddir = '/path/to/upload/directory';
my $ue = CGI::UploadEasy->new(-uploaddir => $uploaddir);
# At this point all the files are saved in $uploaddir.
# For a raw printout of related info, you can do:
my $info = $ue->fileinfo;
my $cgi = $ue->cgiobject;
print $cgi->header('text/plain');
print Dumper $info;
__END__
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
------------------------------
Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 6 Apr 01)
Message-Id: <null>
Administrivia:
#The Perl-Users Digest is a retransmission of the USENET newsgroup
#comp.lang.perl.misc. For subscription or unsubscription requests, send
#the single line:
#
# subscribe perl-users
#or:
# unsubscribe perl-users
#
#to almanac@ruby.oce.orst.edu.
NOTE: due to the current flood of worm email banging on ruby, the smtp
server on ruby has been shut off until further notice.
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
#To request back copies (available for a week or so), send your request
#to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
#where x is the volume number and y is the issue number.
#For other requests pertaining to the digest, send mail to
#perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
#sending perl questions to the -request address, I don't have time to
#answer them even if I did know the answer.
------------------------------
End of Perl-Users Digest V10 Issue 8844
***************************************