473,545 Members | 2,788 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

on the bleeding edge, not sure I belong there...stream_ get_line()

I have urgent need of the function stream_get_line :
http://www.php.net/manual/en/functio...m-get-line.php
which as you can see is only P5 and above. So I went and got the PHP5
source, hoping to find this function and copy it into my script.

found php_streams.h
don't really know what to do with it...I'm learning a little bit of C but
not enough, I suspect.

Is this a fool's hope? Is there an existing (4.3) function that can be
tweaked to do the same job?

If you're still with me, here's why I need it:

I use .csv files in an import script, and one of the fields in these files
has a lot of new line characters. In fact, the "field" is really an entire
page of html. The .csv looks kinda like this:

"spykids.jpg";" na.jpg";"noQval ue";"0.45";"S py Kids";"<big><b> This is a
previously-viewed DVD in the original case. Both the DVD and case are in
excellent condition and come with a life-time guarantee. </big></b><br><br>

<b>The Original One!</B><br>
(2002) Color - 88 Minutes
<br><BR>

....and so on

So the usual fgetcsv() doesn't work -- it interprets each new-line as a new
record (even though it's enclosed within double quotes). My thought is that
using stream_get_line with the double-quote defined as the ending would be
the way to override this behavior.
Jul 17 '05 #1
2 1866
"Matthew Crouch" <ma************ @spamlessverizo n.net> wrote:
"spykids.jpg";" na.jpg";"noQval ue";"0.45";"S py Kids";"<big><b> This is a
previously-viewed DVD in the original case. Both the DVD and case are
in excellent condition and come with a life-time guarantee.
</big></b><br><br>

<b>The Original One!</B><br>
(2002) Color - 88 Minutes
<br><BR>

...and so on

So the usual fgetcsv() doesn't work -- it interprets each new-line as
a new record (even though it's enclosed within double quotes).


It works fine on my system (PHP 4.3.2 on Linux):
fgetcsv($FP, 2048, ";", "\"");

JOn
Jul 17 '05 #2

"Jon Kraft" <jo*@jonux.co.u k> wrote in message
news:Xn******** *************** ***@130.133.1.4 ...
"Matthew Crouch" <ma************ @spamlessverizo n.net> wrote:
"spykids.jpg";" na.jpg";"noQval ue";"0.45";"S py Kids";"<big><b> This is a
previously-viewed DVD in the original case. Both the DVD and case are
in excellent condition and come with a life-time guarantee.
</big></b><br><br>

<b>The Original One!</B><br>
(2002) Color - 88 Minutes
<br><BR>

...and so on

So the usual fgetcsv() doesn't work -- it interprets each new-line as
a new record (even though it's enclosed within double quotes).


It works fine on my system (PHP 4.3.2 on Linux):
fgetcsv($FP, 2048, ";", "\"");

JOn


Very true, thank you. I wasn't using the optional delimiters. Time for
another pot of coffee, I guess.
Jul 17 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
1756
by: James A. Donald | last post by:
in a web page http://jim.com/econ/chap01p1.html I want the first link, pointing to the previous page in the presentation to line up with left hand edge of the page, and the last link, pointing to the next page in the presentation, to line up with the right hand edge of the page, where the problem is complicated by the fact that the links...
0
1532
by: Ferdi Smit | last post by:
I wrote a generic algorithm for boost.graph to merge two vertices, ie. the end-points of an edge are joined together as if they are a single vertex. I'm currently doing this by creating a new vertex, and creating an edge to this new vertex from every incident vertex of any of the end-points (and then deleting the end points and every incident...
2
3826
by: copyco | last post by:
Does anyone have any suggestions on this? I have a form that can be collapsed into a compact size and expanded back to full size. If the user moves the compact size of the form close to the edge, then when it is brought to full size, the right edge goes off the edge of the screen. How can I code to adjust for this? If I code for checking...
3
1633
by: wavedave | last post by:
Hello everyone - I'm trying to build a .NET application (C#) in which my program acts as an add-on to another existing application, providing some additional functionality. The way I want the UI to behave is such that my application's window will dock itself to the right-hand edge of the other app's main window (after resizing that app...
3
1444
by: Oliver Block | last post by:
Hello, CSS21 Spec points the following out (9.4.1): <citation> In a block formatting context, each box's left outer edge touches the left edge of the containing block (for right-to-left formatting, right edges touch). </citation>
2
5976
by: a | last post by:
where could i find an edge detection example in C#
2
10310
by: as | last post by:
Hi folks, am a newbie in C++ world. Normally I use matlab more often. But right now I want to create a Rising Edge D Flip-Flop model which has two Digital inputs, i.e. INPUTDATA and a CLOCK. The functionality of Rising Edge D Flip Flop is that whenever a rising edge of CLOCK signal will occur ( Rising Edge : 0 to 1 ) the output will be the...
0
1361
by: darrenhello | last post by:
hi there, I am doing my last year's project and I have a 'little' problem. I have to do an edge detection filter. for now, some normal edge detection filters that I used worked fine but there a problem. I need an edge detection filter in which I can offset the edge according to a variable that the user gives. The problem is that I got no idea...
0
7689
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7943
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7456
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
6022
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
5076
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3490
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3470
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1044
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
743
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.