用逗号分隔文本字段 [英] Separating Text Fields by comma
问题描述
我使用Perl Tk创建了一个包含多个文本字段的文本小部件。所以它就像一个网页形式,例如
名称:(用户输入xyz)
地址:(用户输入123)
年龄:(用户输入77)
当用户在字段中输入文本并提交文本时,数据将被复制到csv文件中。所以csv文件看起来像这样:
NamexyzAddress123Age77
我希望csv文件看起来像:
Namexyz,Address123,Age77
如何将逗号添加到用户输入的文本中
谢谢
Hi,
I have created a text widget with multiple text fields using Perl Tk. So its like a web form e.g
Name: (user entered xyz)
Address:(user entered 123)
Age:(user entered 77)
When a user enters text in the fields and submits it, the data gets copied to a csv file. So the csv file looks like this:
NamexyzAddress123Age77
I want the csv file to look like:
Namexyz,Address123,Age77
How do I get the comma to be added to the text entered by the user
Thanks
推荐答案
您的代码在哪里写入文件?我们不能告诉你如何在没有看到你的内容的情况下更改你的代码。
Where is your code that writes to the file? We can''t tell you how to change your code without first seeing what you have.
你的代码在哪里写到文件?我们不能告诉你如何在没有看到你拥有的东西的情况下改变你的代码。
Where is your code that writes to the file? We can''t tell you how to change your code without first seeing what you have.
monkies也许? :)
monkies maybe? :)
这是代码:
使用Tk;
打开D, > form3.csv" ;;
Here is the code:
use Tk;
open D, ">form3.csv";
这篇关于用逗号分隔文本字段的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!