I'm extremely new to Rev Media, programming for that matter. I've been a web designer, but have a dilemma. I need to create a web app that allows people to go to the site, enter in there name and submit to query a csv file that then will display the records found in the csv that match their name.
Help.... how can I do this?
Thanks,
Mark
web app to query csv file and display results
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
Re: web app to query csv file and display results
From your description, it sounds like you are talking about using a revlet in a web page that needs to grab data from a static CSV file, yes?
Probably the simplest way is to put the whole csv into a variable. I am guessing that the csv file is on a web server somewhere, so your program could have a line like
At which point you can just search through the variable for lines matching your search term.
Some items to look up in the rev dictionary for this sort of search thing would be lineOffset, itemOffset, (and the other various offsets), matchtext..
If the csv file is huge of course, then an alternate method would be required. Also, if security of the data in the csv file is an issue, again there are most likely better options, but should give you some stuff to experiment with.
Probably the simplest way is to put the whole csv into a variable. I am guessing that the csv file is on a web server somewhere, so your program could have a line like
Code: Select all
put url "http://example.url.com/csvtextfile.csv" into theVariable
Some items to look up in the rev dictionary for this sort of search thing would be lineOffset, itemOffset, (and the other various offsets), matchtext..
If the csv file is huge of course, then an alternate method would be required. Also, if security of the data in the csv file is an issue, again there are most likely better options, but should give you some stuff to experiment with.
mbernard wrote:I'm extremely new to Rev Media, programming for that matter. I've been a web designer, but have a dilemma. I need to create a web app that allows people to go to the site, enter in there name and submit to query a csv file that then will display the records found in the csv that match their name.
Help.... how can I do this?
Thanks,
Mark
-
- VIP Livecode Opensource Backer
- Posts: 1005
- Joined: Sat Apr 08, 2006 3:06 pm
- Contact:
There is a visual example of what sturgis suggested in the lesson.runrev.com site:
How do I get the content of a URL on a web server into Revolution?
After you get the data and use one of the operators that sturgis suggested you can use this lesson to help you display your data in a table field.
How do I Display Tab Delimited Text in a Table Field?
The lesson shows how to do this with tab delimited text. You can convert a basic CSV file to tab delimited use replace:
How do I get the content of a URL on a web server into Revolution?
After you get the data and use one of the operators that sturgis suggested you can use this lesson to help you display your data in a table field.
How do I Display Tab Delimited Text in a Table Field?
The lesson shows how to do this with tab delimited text. You can convert a basic CSV file to tab delimited use replace:
Code: Select all
replace comma with tab in theCSVData
Trevor DeVore
ScreenSteps - https://www.screensteps.com
LiveCode Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode
LiveCode Builder Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode-builder
ScreenSteps - https://www.screensteps.com
LiveCode Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode
LiveCode Builder Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode-builder
Re: web app to query csv file and display results
Thank you both for the response. Is there any way once you bring in the text into the table to suppress seeing it, and then allow a query against the file to then display the results.
Detail: The project is to take a CSV file with 6 fields, from the website, a user will enter a name, parcel, or address to search for their information, the info found will be displayed.
Any help would be appreciated.
Thanks!
Detail: The project is to take a CSV file with 6 fields, from the website, a user will enter a name, parcel, or address to search for their information, the info found will be displayed.
Any help would be appreciated.
Thanks!