从表单到.csv文件到网页帮助请求。 [英] from form to .csv file to webpage help req.

查看:53
本文介绍了从表单到.csv文件到网页帮助请求。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

HI,

我已经设置了一个页面,其中包含一个表单,该表单将数据附加到我的asp

服务器上的.csv文件中,这是为了启用有限的数字用户添加新闻主题到这个文件,包含以下格式的数据

(日期,标题,文章);

181003,新闻标题,新闻文章

" 171003",old news title",news article

form以反向时间顺序添加数据,最新的列表顶部



现在我希望能够将csv文件的内容写入表中单元格,

的格式与页面的其他部分相同(如果我使用include标签,我得到

无格式文本和所有的标记,并且之间没有段落标记

项目。

我是javascript和asp的新手,虽然我对

的基本了解是如何工作的。

有人可以解释最好的实现这个目标的方法,我不是在寻找一个人为我辛勤工作的事情,如果不可能的话,我可以告诉我b $ b需要的,只是一个解释会有很大帮助。

非常感谢提前

StumpY

解决方案




StumpY写道:


HI,
我已经设置了一个页面,其中包含一个将数据附加到.csv的表单我的asp服务器上的文件,这是为了让有限数量的用户能够将新闻线程添加到这个文件中,其中包含以下格式的数据
(日期,标题,文章) ;
181003,新闻标题,新闻文章
171003,较旧的新闻标题,新闻文章
表格添加了数据按时间倒序排列,最新的列表位于列表顶部。
现在我希望能够将csv文件的内容写入表格单元格,
与页面的其他部分相同(如果我使用include标签,我得到
无格式文本和所有的标记,并且
项目之间没有段落标记)。
我是新手javascript和asp,虽然我对
它们是如何工作有基本的了解。
有人可以解释实现这个目标的最佳方式,我不是在寻找某人来做我的辛苦工作,如果无法向我展示所需的编码,只需要一个解释就会有很大帮助。
非常感谢提前
StumpY



http://groups.google.com/groups?hl=e...tel.net&rnum=9


N1 - 有没有办法自动化这个程序?我希望我的用户能够尽可能少地访问该网站。

欢呼回复


狐狸 < fo*@fxmahoney.com>在消息中写道

新闻:3F *************** @ fxmahoney.com ...



StumpY写道:


HI,
我已经设置了一个页面,其中的表格将数据附加到我的
asp服务器上的.csv文件中,这个是为了让有限数量的用户能够将新闻线程
添加到此文件中,该文件包含以下格式的数据
(日期,标题,文章);
181003, ;新闻标题,新闻文章
171003,较旧的新闻标题,新闻文章
表格以反向时间顺序添加数据,最新值为
顶部列表。
现在我希望能够将csv文件的内容写入表
单元格,格式与页面的其余部分相同(如果我使用include标签)我
获取无格式文本和所有文章标记,并且项目之间的
中没有段落标记。)
我是javascript和asp的新手,虽然我有一个基本的你理解
他们是如何工作的。
有人可以解释实现这一目标的最佳方法,我不是在寻找有人为我辛勤工作的人,如果不是可能
向我展示所需的编码,只是解释会有很大的帮助。
非常感谢提前
StumpY



http://groups.google.com/groups?hl=e...tel.net&rnum=9




StumpY写道:

N1 - 有没有办法自动化这个程序?我希望我的用户尽可能少地访问网站。
欢呼回复

Fox < fo*@fxmahoney.com>在消息中写道
新闻:3F *************** @ fxmahoney.com ...


StumpY写道:

HI,
我已经设置了一个页面,其中的表格将数据附加到我的
asp
服务器上的.csv文件中,这个是为了让有限数量的用户能够添加新闻主题
这个文件,其中包含以下格式的数据
(日期,标题,文章);
181003,新闻标题,新闻文章
171003,较旧的新闻标题,新闻文章
表格以最新的时间顺序添加数据与最新在列表的顶部
现在我希望能够将csv文件的内容写入表格
单元格,
格式化为页面的其余部分(如果我使用include标签我
得到
无格式文本和
项目之间的所有语音标记和段落标记)。
我是javascript和asp的新手gh我对他们的工作方式有一个基本的了解。
有人可以解释实现这个目标的最好方法吗,我不是在寻找
有人为我辛勤工作,如果不可能
给我看所需的编码,只需要一个解释就会有很大帮助。
非常感谢提前 StumpY



http://groups.google.com/groups?hl=e...tel.net& rnum = 9




Fox没有看到你有ASP,所以你要找的是

服务器端解决方案。


在ASP上,程序将是:


1)使用FileSystemObject加载文本文件。

2)对于每一行,在JavaScript数组的字段中拆分行,使用

方法strLine.split (,, );其中strLine是从

文本文件中读取的行。

3)使用字符串中的数组字段构建表。

4)在Response对象中传递构建的字符串,如:

Response.Write(strHtml);


如果您遇到麻烦,请问我我可以用一个小例子给你




HTH,


Laurent

-

Laurent Bugnion,GalaSoft

网页设计,Java,javascript http://www.galasoft-LB.ch

私人/马来西亚: http://mypage.bluewin.ch/lbugnion

支持加尔各答的儿童:< a rel =nofollowhref =http://www.calcutta-espoir.chtarget =_ blank> http://www.calcutta-espoir.ch


HI,
I have set up a page with a form which appends data to a .csv file on my asp
server, this is to enable a limited number of users to add news threads to
this file, which contains the data in the following format
(date,headline,article);
"181003","news title","news article"
"171003","older news title","news article"
The form adds the data in reverse chronological order with newest at the top
of the list.
Now I wish to be able to write the contents of the csv file to a table cell,
formatted the same as the rest of the page (if I use the include tag I get
unformatted text and all the speach marks and no paragraph tag in between
items).
I am new to javascript and asp, although I do have a basic understanding of
how they work.
Could someone kindly explain the best way to achieve this, I''m not looking
for someone to do my hard work for me nessacerely, if it isn''t possible to
show me the coding needed, just an explanation will help greatly.
Many thanks in advance
StumpY

解决方案



StumpY wrote:


HI,
I have set up a page with a form which appends data to a .csv file on my asp
server, this is to enable a limited number of users to add news threads to
this file, which contains the data in the following format
(date,headline,article);
"181003","news title","news article"
"171003","older news title","news article"
The form adds the data in reverse chronological order with newest at the top
of the list.
Now I wish to be able to write the contents of the csv file to a table cell,
formatted the same as the rest of the page (if I use the include tag I get
unformatted text and all the speach marks and no paragraph tag in between
items).
I am new to javascript and asp, although I do have a basic understanding of
how they work.
Could someone kindly explain the best way to achieve this, I''m not looking
for someone to do my hard work for me nessacerely, if it isn''t possible to
show me the coding needed, just an explanation will help greatly.
Many thanks in advance
StumpY



http://groups.google.com/groups?hl=e...tel.net&rnum=9


N1 - is there any way to automate this procedure? I want my users to have
as little ''access'' to the site as possible.
Cheers for the reply

"Fox" <fo*@fxmahoney.com> wrote in message
news:3F***************@fxmahoney.com...



StumpY wrote:


HI,
I have set up a page with a form which appends data to a .csv file on my asp server, this is to enable a limited number of users to add news threads to this file, which contains the data in the following format
(date,headline,article);
"181003","news title","news article"
"171003","older news title","news article"
The form adds the data in reverse chronological order with newest at the top of the list.
Now I wish to be able to write the contents of the csv file to a table cell, formatted the same as the rest of the page (if I use the include tag I get unformatted text and all the speach marks and no paragraph tag in between items).
I am new to javascript and asp, although I do have a basic understanding of how they work.
Could someone kindly explain the best way to achieve this, I''m not looking for someone to do my hard work for me nessacerely, if it isn''t possible to show me the coding needed, just an explanation will help greatly.
Many thanks in advance
StumpY



http://groups.google.com/groups?hl=e...tel.net&rnum=9


Hi,

StumpY wrote:

N1 - is there any way to automate this procedure? I want my users to have
as little ''access'' to the site as possible.
Cheers for the reply

"Fox" <fo*@fxmahoney.com> wrote in message
news:3F***************@fxmahoney.com...


StumpY wrote:

HI,
I have set up a page with a form which appends data to a .csv file on my
asp
server, this is to enable a limited number of users to add news threads
to
this file, which contains the data in the following format
(date,headline,article);
"181003","news title","news article"
"171003","older news title","news article"
The form adds the data in reverse chronological order with newest at the
top
of the list.
Now I wish to be able to write the contents of the csv file to a table
cell,
formatted the same as the rest of the page (if I use the include tag I
get
unformatted text and all the speach marks and no paragraph tag in
between
items).
I am new to javascript and asp, although I do have a basic understanding
of
how they work.
Could someone kindly explain the best way to achieve this, I''m not
looking
for someone to do my hard work for me nessacerely, if it isn''t possible
to
show me the coding needed, just an explanation will help greatly.
Many thanks in advance
StumpY



http://groups.google.com/groups?hl=e...tel.net&rnum=9



Fox didn''t see that you have ASP, so what you''re looking for is a
server-side solution.

On ASP, the procedure would be to:

1) Load the text file, using the FileSystemObject.
2) For each line, split the line in fields in a JavaScript array, using
the method strLine.split( "," ); where strLine is the line read form the
text file.
3) Build your table using the array''s fields in a string.
4) Pass the built string in the Response object, like:
Response.Write( strHtml );

If you have troubles implementing this, ask me and I can provide you
with a small example.

HTH,

Laurent
--
Laurent Bugnion, GalaSoft
Webdesign, Java, javascript: http://www.galasoft-LB.ch
Private/Malaysia: http://mypage.bluewin.ch/lbugnion
Support children in Calcutta: http://www.calcutta-espoir.ch


这篇关于从表单到.csv文件到网页帮助请求。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆