将数据转换为mysql数据库

发布于 2024-08-04 13:30:58 字数 518 浏览 8 评论 0原文

我有一组 200 文档 (*.doc),其中包含如下数据。我想将其上传到数据库(mysql)。如何转换它?有什么简单的步骤可以做吗?我正在使用 ubuntu 操作系统

 1) Name:           MR RAMESH KUMAR
    Address:        23/64,PANKAJ RESIDENCY
                    HYDERABAD
                    ANDHRA PRADESH
    Residence Tel:  8712455
    Office Tel:     456456  
    E-mail:         [email protected]

i have set of 200 documents (*.doc) containing data as follows . I want to upload it to database (mysql). how to convert it? Is there any easy steps to do? i'm using ubuntu os

 1) Name:           MR RAMESH KUMAR
    Address:        23/64,PANKAJ RESIDENCY
                    HYDERABAD
                    ANDHRA PRADESH
    Residence Tel:  8712455
    Office Tel:     456456  
    E-mail:         [email protected]

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

不一样的天空 2024-08-11 13:30:58

我建议先将其放入 CSV 中。

I would recommend getting it into a CSV first.

笨笨の傻瓜 2024-08-11 13:30:58

我同意蒂施的观点,但我会提供一些细节,让您走上正确的道路:
您可以使用程序或使用文字处理程序来执行此操作

1.清除名称:

2.用 替换其他列名称,但请确保取出新行:

例如:
替换

\nResidence Tel:  

,

3.使用任何实用程序将这些记录插入数据库,谷歌将 csv 导入到我的 sql。

I agree with Tisch, but I will provide some details to put you on the right way:
You can use a program or do it with the word processor

1.Clear name:

2.replace other column names with , but make sure you take the new line out:

example:
replace

\nResidence Tel:  

with

,

3.Use any utility to insert these records to the database, google for csv import to my sql.

み青杉依旧 2024-08-11 13:30:58

您需要将这些文件合并为一个大文本文件,尤其是当每个文档仅包含一条记录时。这将是最大的障碍。用逗号分隔字段,用换行符分隔记录。将每个字段用引号引起来。最后应该有一个 200 行的文件。我建议使用具有宏功能的编辑器。请注意包含逗号的字段,并确保它们最终位于引号内。

"MR RAMESH KUMAR", "23/64,PANKAJ RESIDENCY", "HYDERABAD", "ANDHRA PRADESH", "8712455", "456456", "[email protected]"

接下来,使用编辑器在每一行上放置 INSERT 语句,

INSERT INTO people p (FullName, Residency, ..., Email) VALUES ("MR RAMESH KUMAR", "23/64,PANKAJ RESIDENCY", "HYDERABAD", "ANDHRA PRADESH", "8712455", "456456", "[email protected]");

然后在数据库管理工具中运行 INSERT 语句。就是这样!

You need to combine the files into one large text file, especially if each document only contains one record. That is going to be the biggest hurdle. Separate fields with commas, and records with linebreaks. Wrap each field in quotation marks. You should have a 200-line file at the end. I suggest using an editor with macro functionality. Be aware of fields that contain commas, and make sure they end up inside the quotation marks.

"MR RAMESH KUMAR", "23/64,PANKAJ RESIDENCY", "HYDERABAD", "ANDHRA PRADESH", "8712455", "456456", "[email protected]"

Next, use your editor to put an INSERT statement on each line

INSERT INTO people p (FullName, Residency, ..., Email) VALUES ("MR RAMESH KUMAR", "23/64,PANKAJ RESIDENCY", "HYDERABAD", "ANDHRA PRADESH", "8712455", "456456", "[email protected]");

Then, run the INSERT statements in your database admin tool. That's it!

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文