需要帮助从 txt 文件收集数据并将其插入网页吗?
有人可以建议我从一个来源收集数据、选择特定数据并将其插入网页的最有效方法吗?具体来说,我希望:
- 调用此浮标数据文本文件: http://www .ndbc.noaa.gov/data/realtime2/46237.txt
- 查找水温并将该值插入我的网页中。
第一个大问题:我应该使用什么脚本语言? (我假设 Fortran 不是一个选项:-)
第二个不太大的问题:这个相同的数据集以图形和 xml 格式提供。这两种数据格式是否比 .txt 文件更有用?
提前致谢。
could someone advise me on the most efficient way to gather data from one source, select a specific piece of data and insert it in a web page? Specifically, I wish to:
- Call up this buoy data text file: http://www.ndbc.noaa.gov/data/realtime2/46237.txt
- Find the water temperature and insert that value in my web page.
First big question: What scripting language should I use? (I'm assuming Fortran is not an option :-)
Second not so big question: This same data set is available in graphic and xml format. Would either of these data formats be more useful than the .txt file?
Thanks in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
使用 Perl。
(嘿,你问了。通常,一个程序可以使用通常使用的任何一种语言。)
XML 格式不会比文本格式更有用。
Use Perl.
(Hey, you asked. Normally one programs in whatever language one would normally use.)
The XML format won't be much more useful than the text format.
这种文本文件格式非常简单。几乎任何脚本或通用编程语言都可以使用。关键部分是在正则表达式“\s+”上分割每一行。即在 Python 中它将是:
所以基本上选择您认为最简单的编程语言。任何 .NET 语言都同样有能力,还有 ruby、python、scheme 等。我个人不喜欢 perl,因为我发现它很难阅读
This text file format is just about as simple as it could ever get. Just about any scripting or general purpose programming language will work. The critical part is to split each line on a regex "\s+". i.e. in Python it would be:
So basically choose whatever programming language seems easiest to you. Any .NET language would be equally capable, as well as ruby, python, scheme, etc. I personally have a distaste for perl because I find it very difficult to read