|
Posted by Jerry Stuckle on 12/17/33 11:56
Ørjan Langbakk wrote:
> Den 14.08.2006 22:23, skriblet Gary Hasler følgende:
>
>>> But why not create a seperate csv (if you really want it seperate) if
>>> you're
>>> already using it's capabilities?
>>
>>
>>> ...It seems more logical/maintainable to me. It seems even more
>>> logical to me
>>> to keep the price in the original CSV, and to maintain it there. It's
>>> not
>>> that hard to write a framework than can manipulate a csv as easily as
>>> a flat
>>> table.
>>
>>
>> I agree totally. I store a list of about 40 unit rate prices for our
>> online
>> quote system as a very small .csv file, and our cost estimating staff
>> can easily
>> load it in Microsoft Excel and play with it all they want without
>> having to get
>> into databases at all. When they're finished, I upload it to the
>> server easy as
>> pie.
>
>
> Well... I use TextPad for my webcoding, and has no problems using that
> with custom highlights for CSV :)
>
> But still, I kinda don't understand how I would extract only ONE value
> for each row in the CSV file, into the other file. If someone can point
> me in the right direction for something like that, it would be great -
> the lesser the files to maintain, the better.
>
>
You're going to want to extract at least 2 values - the item number and
the price. Otherwise, what happens if, for instance, the first line got
deleted? You might be selling a $75,000 Jaguar for $0.75.
Using require_once is easy - but it means you have to parse the entire
file. If it's long, that might be a problem. A csv file requires you
to parse every line until you get to the one you want (unless you have
fixed length blocks of data, random access will not work).
But OTOH, if you've got that much data you really need a database
anyway, so I'm assuming the amount of data is limited. In that case
either way should not be that much of a performance problem.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================
Navigation:
[Reply to this message]
|