Tamara Temple wrote:
On Thu, 15 Mar 2012 12:09:53 -0500, Jay Blanchard
sent:
I thought that fgetcsv returned an array. I can work with it like an
array but I get the following warning when using it
|Warning: implode(): Invalid arguments passed on line 155
154$csvCurrentLine = fgetcsv($c
On Thu, 15 Mar 2012 12:09:53 -0500, Jay Blanchard
sent:
I thought that fgetcsv returned an array. I can work with it like an
array but I get the following warning when using it
|Warning: implode(): Invalid arguments passed on line 155
154 $csvCurrentLine = fgetcsv($csvFile, 4096, ',');
[snip]
Not sure why, but ok. Thanks everyone!
An empty line would lead to $csvCurrentLine == array() which as a boolean would
be false but would not necessarily mean EOF. By using === to check the value
the expression will only evaluate to false at EOF or an error.
-Stuart
[/snip]
Makes per
On 15 Mar 2012, at 20:26, Jay Blanchard wrote:
> [snip]
>> Please, don't do that. Use this instead:
>> while (($csvCurrentLine = fgetcsv($csvFile, 4096, ',')) !== FALSE) {
>> }
>> [/snip]
>
> Not sure why, but ok. Thanks everyone!
An empty line would lead to $csvCurrentLine == array() which as a
[snip]
> Please, don't do that. Use this instead:
> while (($csvCurrentLine = fgetcsv($csvFile, 4096, ',')) !== FALSE) {
> }
> [/snip]
Not sure why, but ok. Thanks everyone!
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
On Thu, Mar 15, 2012 at 6:40 PM, Andrew Ballard wrote:
> On Thu, Mar 15, 2012 at 1:29 PM, Jay Blanchard
> wrote:
>> On 3/15/2012 12:23 PM, Matijn Woudt wrote:
>>>
>>> On Thu, Mar 15, 2012 at 6:09 PM, Jay Blanchard
>>> wrote:
I thought that fgetcsv returned an array. I can work with it
Jay Blanchard wrote:
154 $csvCurrentLine = fgetcsv($csvFile, 4096, ',');
155 $currentLine = implode(",", $csvCurrentLine);
I am using it in a loop. End Of File is an error?
You certainly need to break out on $csvCurrentLine = false which indicates end
of file at least.
My own 'loo
On Thu, Mar 15, 2012 at 1:29 PM, Jay Blanchard
wrote:
> On 3/15/2012 12:23 PM, Matijn Woudt wrote:
>>
>> On Thu, Mar 15, 2012 at 6:09 PM, Jay Blanchard
>> wrote:
>>>
>>> I thought that fgetcsv returned an array. I can work with it like an
>>> array
>>> but I get the following warning when using
On 03/15/2012 10:09 AM, Jay Blanchard wrote:
I thought that fgetcsv returned an array. I can work with it like an
array but I get the following warning when using it
|Warning: implode(): Invalid arguments passed on line 155
154 $csvCurrentLine = fgetcsv($csvFile, 4096, ',');
155 $currentLine =
On 3/15/2012 12:23 PM, Matijn Woudt wrote:
On Thu, Mar 15, 2012 at 6:09 PM, Jay Blanchard
wrote:
I thought that fgetcsv returned an array. I can work with it like an array
but I get the following warning when using it
|Warning: implode(): Invalid arguments passed on line 155
154 $csvCur
On Thu, Mar 15, 2012 at 6:09 PM, Jay Blanchard
wrote:
> I thought that fgetcsv returned an array. I can work with it like an array
> but I get the following warning when using it
>
> |Warning: implode(): Invalid arguments passed on line 155
>
> 154 $csvCurrentLine = fgetcsv($csvFile, 4096, ',
You are so right, takes all of 0.122 s to process the whole file with
the fgetcsv inside the while loop Guess I need to look up why this
was the problem.
Thanks everyone!
On Wed, 2008-01-09 at 20:59 -0600, Richard Lynch wrote:
> 6500 rows is chump-change.
>
> You probably don't have the fge
Um, I've read the manual.
On Wed, 2008-01-09 at 20:11 -0500, Bastien Koert wrote:
> http://ca.php.net/manual/en/function.fgetcsv.php
> _
> Discover new ways to stay in touch with Windows Live! Visit the City @ Live
> today!
> http:/
6500 rows is chump-change.
You probably don't have the fgetcsv inside the while loop to get past
the first row... :-)
On Wed, January 9, 2008 6:09 pm, Danny Brow wrote:
> I need to compare the first field of each row. But this idea is shot
> to
> hell, i've been running one of the examples on the
On Wed, January 9, 2008 4:35 pm, Danny Brow wrote:
> I'm trying to compare a value to the first field in a csv fILE
> (example
> of the data below). Using while takes too long and I can't figure out
> how to compare just one row at a time. I've tried some variations of
> the
> following.
>
>
> //Co
http://ca.php.net/manual/en/function.fgetcsv.php
_
Discover new ways to stay in touch with Windows Live! Visit the City @ Live
today!
http://getyourliveid.ca/?icid=LIVEIDENCA006
--
PHP General Mailing List (http://www.php.net/)
To un
Danny Brow wrote:
I need to compare the first field of each row. But this idea is shot to
hell, i've been running one of the examples on the file and it's been
about an hour+ already... 6500 records have to be checked... I think
MySQL is calling my name right now.
Thanks,
Dan
On Thu, 2008-01-1
I need to compare the first field of each row. But this idea is shot to
hell, i've been running one of the examples on the file and it's been
about an hour+ already... 6500 records have to be checked... I think
MySQL is calling my name right now.
Thanks,
Dan
On Thu, 2008-01-10 at 09:59 +1100, Ch
Danny Brow wrote:
Hi Everyone,
I'm trying to compare a value to the first field in a csv fILE (example
of the data below). Using while takes too long and I can't figure out
how to compare just one row at a time. I've tried some variations of the
following.
So are you trying to compare the firs
On Jan 9, 2008 5:35 PM, Danny Brow <[EMAIL PROTECTED]> wrote:
> Hi Everyone,
>
> I'm trying to compare a value to the first field in a csv fILE (example
> of the data below). Using while takes too long and I can't figure out
> how to compare just one row at a time. I've tried some variations of the
Danny Brow wrote:
Hi Everyone,
I'm trying to compare a value to the first field in a csv fILE (example
of the data below). Using while takes too long and I can't figure out
how to compare just one row at a time. I've tried some variations of the
following.
//Common for all trials
$demoID = fop
Binoy AV wrote:
> Could anybody please tell me how to read the data from an excel file ?
> It should work independent of the operating system. I don't want the csv
> format.
For your first step, you'll have to convince Microsoft to OpenSource their
code...
Oh, yeah.
You can't do that.
:-)
--
On Fri, 2005-02-18 at 09:12, M. Sokolewicz wrote:
> Binoy AV wrote:
>
> > Thanks Jay.
> >
> > Could anybody please tell me how to read the data from an excel
file ? It should work independent of the operating system. I don't want
the csv format.
> excel files aren't independent of the OS,
Binoy AV wrote:
Thanks Jay.
Could anybody please tell me how to read the data from an excel file ? It should work independent of the operating system. I don't want the csv format.
excel files aren't independent of the OS, csv files are. Excel files
need to be parsed, because they contain he
[snip]
Could anybody please tell me how to read the data from an excel file ?
It should work independent of the operating system. I don't want the csv
format.
[/snip]
Start here http://us4.php.net/com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/u
Thanks Jay.
Could anybody please tell me how to read the data from an excel file ? It
should work independent of the operating system. I don't want the csv format.
Binoy
__ __ __ __
Sent via the WebMail system at softwareassociates.co
[snip]
Thanks for the reply.
It shows ÐÏࡱá>\\þÿ etc.
source code I used is
$handle = fopen ("file.xls","r");
while ($data = fgetcsv ($handle, 1000, ","))
{
$num = count($data);
for ($c=0; $c < $num ; $c++)
{
$str_email = $data[$c];
ec
Hi,
Thanks for the reply.
It shows ÐÏࡱá>\\þÿ etc.
source code I used is
$handle = fopen ("file.xls","r");
while ($data = fgetcsv ($handle, 1000, ","))
{
$num = count($data);
for ($c=0; $c < $num ; $c++)
{
$str_email = $data[$c];
echo $st
[snip]
I used fgetcsv() function to get the data from a excel file.
While reading the data it shows some special characters .
I found the same problems in
http://bugs.php.net/bug.php?id=12127&edit=2
Is it a bug?
[/snip]
What special characters does it show?
--
PHP General Mailing List
zhuravlev alexander wrote:
Hello.
I wonder if PHP has fgetcsv() function why doesn't
PHP has fputcsv ?
-- zhuravlev alexander
u l s t u n o c
([EMAIL PROTECT
I thought about this possibility, but it turns out 4 different scripts on
the same server accessing different files from different locations and
using different methods are all failing.
Chris
At 07:53 PM 3/9/2003, Jason Sheets wrote:
Check to make sure the file exists, you should probably throu
Check to make sure the file exists, you should probably through some
debug code around the area that is failing.
Jason
On Sun, 2003-03-09 at 18:50, CDitty wrote:
> I have a customer who's webhost upgraded their server recently and a script
> that was working fine quit working. The error they are
Hello,
"Justin French" <[EMAIL PROTECTED]> wrote:
[snip]
> Sample line from your CSV should look like this:
>
> ---
> "1","foo","harry said \"what is it?\"","foo"
> "1","bah","\"don't know\" said sally","something"
> ---
>
> When echoing these values to the browser, you would strip the slashes.
I did email the company that the csv feed is coming from so we'll see what
comes of that. I really hope they fix it.
Well here is what I did to solve the problem:
I pulled the csv file in using file(), then found the string length, used
substr() to get rid of the first double quote in the line a
How is the CSV being generated? Seems to me like your problem isn't
ggetcsv(), but rather the file itself.
Commonly, a CSV file is a series of values, separated by a comma (duh!!).
The separated values are generally enclosed in double quotes ("), as it
would appear yours are.
Any double quotes
Richard,
> I am parsing a csv file with fgetcsv and the fields are surrounding by
> double quotes, now I am running into a problem periodically that when
there
> are quotes within the value it is treating it like another value instead
of
> the same value.
> Any ideas on how to get around that?
>
>
Hello,
Just remember that fgetcsv() returns an array. So the first column is
$thearray[0];
You can just pass it to the function that generates the image BEFORE you go
to the next line of your csv file.
Or, am I missing something?
- E
On Saturday, October 12, 2002 2:05 AM
Bryan Koschmann wr
> Thanks - what I want to do is just say something like
> fputcsv($myarray) - and not have to worry about putting in the
> commas or whatever myself... will fputs do that?
>
> (In case it wasn't clear - I'm wanting to write back to the
> file, having already read from it using fgetcsv)
How ab
PHP News
Subject: RE: [PHP] fgetcsv
> Hi all - just wondering if anyone knows of a function like
> fputcsv - that is, writes a line to a csv file - opposite of fgetcsv.
A CSV file is just a text file with a different file extension,
so you can use fgets to write it out...
Jason
--
PHP
> Hi all - just wondering if anyone knows of a function like
> fputcsv - that is, writes a line to a csv file - opposite of fgetcsv.
A CSV file is just a text file with a different file extension,
so you can use fgets to write it out...
Jason
--
PHP General Mailing List (http://www.php.net/)
40 matches
Mail list logo