/    Sign up×
Community /Pin to ProfileBookmark

Using Comma-delimited text files in page

I have a little bit different challenge to solve. ?

I have a customer who is a car dealer. He has a database that can only export data to comma-delimited text files. He wants to minimise data-entry repetition by using the data from those files to populate web pages with this data about the cars he has for sale. Max is about 30 vehicles, so a database on the server side is not practical for this.

Each car can be a seperate file (by Stock #), or I can have him export the ENTIRE list of cars to one text file. 3 photos will accompany each vehicle. He wishes to do the updates to the website himself, which is reasonable, but he is NOT tech savvy, so I have to automate this as much as possible.

Each vehicle would have it’s own page on the site, and a list of all vehicles on the main page to link to each vehicle page…

I’m a bit rusty on this kind of thing, so I was hoping for some suggestions on how to approach this ?

Thanks in advance…
Fred

to post a comment
JavaScript

3 Comments(s)

Copy linkTweet thisAlerts:
@hyperliskApr 11.2006 — You could create one page, and pass in values through the URL. ie
<i>
</i>cars.html?carID=1&amp;img1=images/image1.jpg&amp;img2=images/image2.jpg&amp;img3=images/image3.jpg

Then just get the variables out of the URL and place the proper contents in a DIV or any other element.
Copy linkTweet thisAlerts:
@A1ien51Apr 11.2006 — Look into Ajax XMLHttpRequest Object with an text file.

You can use the responseText and do a split(",") to get the data in an array and handle it that way.

Eric
Copy linkTweet thisAlerts:
@phpnoviceApr 11.2006 — The only consideration will be if this comma-delimited data also contains commas within quoted text. If so, it would be better to use PHP on the server-side to parse the data (because PHP understands the CSV format) and hand it off to JavaScript pre-parsed. Of course, to use the XMLHttpRequest object, you're going to need some server-side document anyway.
×

Success!

Help @wtiger2 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.4,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...