文本文件 [英] text files

查看:92
本文介绍了文本文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在为网上商店做perl,并想知道是否有人知道某种方式(

脚本)将我的文本文件存入我的数据库?

Im doing perl for an online store and wondering if someone knew a way (a
script) to get my text files in to my database?

推荐答案

Ethan写道:
我正在为一个在线商店做perl,并想知道是否有人知道一种方式(一个
脚本)来获取我的文本文件我的数据库?
Im doing perl for an online store and wondering if someone knew a way (a
script) to get my text files in to my database?




如果你可以把你的文本文件变成sql-dump-format,那么应该很容易。


所以你应该准备好数据库,然后创建表格,然后提交具有行的b $ b,例如:


插入yourtablename值(1, 2,''some text'');

插入yourtablename值(2,2,''其他文本'');

插入yourtablename值(3 ,2,''其他一些文字'');


价值部分当然会根据你的桌面结构而改变。


然后如果你有一个名为dump.sql的文件你可以使用mysql控制台程序将它变成

mysql:


mysql -u root databasename< dump.sql



If you can get your text files into sql-dump-format, then it should be easy.

So you should have the database ready, and tables created and then file
that has rows for example like this:

insert into yourtablename values(1,2,''some text'' );
insert into yourtablename values(2,2,''some other text'' );
insert into yourtablename values(3,2,''some other text'' );

The values part of course change according to your table structure.

Then if you have this in a file called dump.sql you can get it into
mysql using mysql console program:

mysql -u root databasename < dump.sql


Ethan写道:
我正在为一家网上商店做perl,并想知道某人是否知道某种方式(
脚本) )将我的文本文件存入我的数据库?
Im doing perl for an online store and wondering if someone knew a way (a
script) to get my text files in to my database?




如果你可以将你的文本文件变成sql-dump-format,那么它应该很容易。


所以你应该准备好数据库,并创建表格,然后提交

,例如这样的行:


插入yourtablename值(1,2,''some text'');

插入yourtablename值(2,2,''some other text'');

插入yourtablename值(3,2,''其他一些文本'');


值部分当然会根据您的表结构而改变。


那么如果你在一个名为dump.sql的文件中有这个,你可以使用mysql控制台程序将它变成

mysql:


mysql -u root databasename< dump.sql



If you can get your text files into sql-dump-format, then it should be easy.

So you should have the database ready, and tables created and then file
that has rows for example like this:

insert into yourtablename values(1,2,''some text'' );
insert into yourtablename values(2,2,''some other text'' );
insert into yourtablename values(3,2,''some other text'' );

The values part of course change according to your table structure.

Then if you have this in a file called dump.sql you can get it into
mysql using mysql console program:

mysql -u root databasename < dump.sql


Ethan写道:
我正在为一家网上商店做perl,并想知道某人是否知道某种方式(
脚本) )将我的文本文件存入我的数据库?
Im doing perl for an online store and wondering if someone knew a way (a
script) to get my text files in to my database?




如果你可以将你的文本文件变成sql-dump-format,那么它应该很容易。


所以你应该准备好数据库,并创建表格,然后提交

,例如这样的行:


插入yourtablename值(1,2,''some text'');

插入yourtablename值(2,2,''some other text'');

插入yourtablename值(3,2,''其他一些文本'');


值部分当然会根据您的表结构而改变。


那么如果你在一个名为dump.sql的文件中有这个,你可以使用mysql控制台程序将它变成

mysql:


mysql -u root databasename< dump.sql



If you can get your text files into sql-dump-format, then it should be easy.

So you should have the database ready, and tables created and then file
that has rows for example like this:

insert into yourtablename values(1,2,''some text'' );
insert into yourtablename values(2,2,''some other text'' );
insert into yourtablename values(3,2,''some other text'' );

The values part of course change according to your table structure.

Then if you have this in a file called dump.sql you can get it into
mysql using mysql console program:

mysql -u root databasename < dump.sql


这篇关于文本文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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