I'm new in html.
how do i convert a .csv file into a table to show in html.
conditions.
the html needs to extract the .csv content and show it on table form on chrome.
the headers are fixed but the data will be updated every week, so html should be able to extract the correct data. only need to update the .csv file.
either you could do it like Ashik said and switch to a database and load everything via php or another programming language, or you try the direct way. Because of how you asked the question I think you don't have any database or knowledge of other programming languages.
Try to use a javascript library, for example jquery and one of its many plugins to achieve this.
Try this for example: https://code.google.com/p/jquerycsvtotable/
I havn't tried it, but it looks promising, maybe it helps you.
Related
Hello, my question is simple but I don't know if it's possible to realize it.
I've got json files structured like that one in the picture and I'd like to use these files, (actually I'd like to use the information contained in them), to create a database. I wanted to understand if it's possible to do this, without the necessity of transcribing all information again, but simply by moving the files into the database that will automatically save them in it.
I'm trying to write a Macro that retrieves data on all HTTP Post forms from a webpage, and then displays the possible inputs as column headings in a worksheet. (Later I'll write another macro that constructs the appropriate requests based on input from the rows below.)
I've spent a day trying to parse the HTML with regex, (classic rookie mistake, right?), and it's a disaster. Nothing seems to work for more than a couple of webpages.
My question is sort of a big picture one. Should it be able to work with REGEX? Should I be taking an entirely different approach? Is this too big a task for someone who doesn't know a whole lot about html, and web development more broadly? I thought it would be a simple project, but it just doesn't seem to be.
don't use regex. use an html parser. Since you said you're using vba, I'll make a guess that you have excel installed. excel has a "import data from web" function that works on any well formed html table.
and if that doesn't work, most platforms that have vba also have a web browser control of some kind. load your target web page in an instance of said control, and access the table you want with the DOM's methods.
I am building a website with ROR 3. I need to provide a page to my clients wherein he could edit his pricing info regarding the application. I am quite confused on how to do this. The pricing page needs to be displayed as an html table with different columns which has got the pricing info.
I am thinking of different ways to do this.
1) Allow the client to create and upload an html page and then save it as a file in my public directory and render as an when the client clicks on the pricing link.
2) The clients may not have bare technical knowledge, hence make the client upload some other formats like Word, Excel etc and then parse it and store it as an HTML file in the public directory.
3) Provide the client with some real time editing tools where in the client could edit in a fixed format, and after wards save the file and render it later.
Also, I wouldn't like to store these infos in my database. There would be quite a few number of clients and hence managing all these data in my database would become cumbersome. Storing all these as plain html files and rendering it later would be the most ideal thing for me.
There might be other better steps in doing this as well. Could you please suggest which might the better, or any other option that could suit my needs? Basically I would want my clients to have a mechanism where they could provide there pricing details, edit it later and display it back as an html table, all this without using an Database backend. Any suggestions would be mostly appreciated.
Good way is Excel(csv format).
You can do PHP with Excel. I thing this is the best solutions for your requirement.
Try this.
http://php.net/manual/en/function.fgetcsv.php
If you are give authority to user to change edit contain and you have to used " CSV or Excel" please see these links:
Importing CSV and Excel
Exporting CSV and Excel
If you really don't want to use database then you can use YAML as a structured storage.
e.g. ( you, most probably, could come up with a better structure )
SMS_Pack:
Sl_No:
1: 10000
2: 25000
3: 50000
You can read those .yml files and parse them as hashes. Should be fairly easy to represent that hash as a HTML table.
For the creation, I'm sure you can come up with some dynamic form input. Or to just let the client send this kind of file ( which might not be the best solution ).
But it just might be easier to manage all of this information within a database.
I'm new in this subject so this might be a silly question for most of you. I have a simple server which several users will access. If any of them change a CSS property of an element, the others should be able to see the change in real time.
Should I use something like node.js to perform this? How do I save the changes the users do?
The page would look something like this: http://stom89.dyndns.org/
Thanks!
I guess what you want to change in your CSS / html , are states. Like if a lamp is on/off? Then you need to save each state in a mySQL DB and just grab the data for each user. If you want it to look like realtime for online users, then use js(ajax) to sync data regularly.
Alternative way without a DB would be with files.
If you don't wanna use mysql for this, you can use files. I suggest using ini files. For more on how to read/write ini files, you can visit this question. It's super simple and you'll be able to have each variable in a nifty array.
What you need: A bit of PHP, a little bit of jQuery (or js), understanding of GET variables
I suggest you create 3 files.
index.php :
Your main page which is the client. Pulls info using get
variables. You can use jQuery.get() for this.
getstate.php :
This is the file which will read the ini file and give you back the states for each device. Read them with jQuery.get() from index.php .
savestate.php:
This is the file which you'll send the new states to from index.php Example request: http://address.goes.here/savestate.php?bedroomlight=1&garagelight=0
Whats even more interesting is that ini files can be written/read easily by many programming languages so you can manipulate the data using your Raspberry Pi easily. (say someone turns of a light, a script polling state could change the ini file)
I think you would need to use a sql database and have a javascript to detect changes and update through AJAX. That's my best idea.
I have been messing with this subject for sometime if I completely understand your question. I would suggest looking at python, ruby or node.js though I could not say which is the easiest to learn for you though I would suggest python and a comet server which could be ape and simply have the server push the updates to the users that are already on the site.
Edit:
Suggestions for polling :: jQuery
http://api.jquery.com/jQuery.get/ for standard data retrieval which is about all you will need.
For example i would like to input a list of students into a database, can you suggest any formatted csv file or excel?.. what would be the best?..any suggestions would be appreciated! thanks! :D
There are far more libraries available for a wider range of languages to work with CSV than Excel files, so if those are the only two choices, I'd strongly suggest CSV.
But if you're putting them into a database, you could probably write a nice tool to either prompt a human to enter all the data into a database, or scrape an existing source of student information to push into the database. I mean, the whole point of having the database is so you can write queries, so might as well write some tools for putting data in too. :)