MySQL社区

 找回密码
 注册

QQ登录

只需一步,快速开始

扫一扫,访问微社区

搜索
查看: 2409|回复: 1
打印 上一主题 下一主题

[PHP相关] 【求助】MySql 读取特殊格式txt文档到表中问题

[复制链接]
跳转到指定楼层
1#
发表于 2014-4-22 13:11:24 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
# Wikipedia elections (http://cs.stanford.edu/people/jure/pubs/triads-chi10.pdf). Data format:
#   E: is election succesful (1) or not (0)
#   T: time election was closed
#   U: user id (and username) of editor that is being considered for promotion
#   N: user id (and username) of the nominator
#   V: <vote(1:support, 0:neutral, -1ppose)> <user_id> <time> <username>
E        1
T        2004-09-21 01:15:53
U        30        cjcurrie
N        32        andyl
V        1        3        2004-09-14 16:26:00        ludraman
V        -1        25        2004-09-14 16:53:00        blankfaze
V        1        4        2004-09-14 17:08:00        gzornenplatz
V        1        5        2004-09-14 17:37:00        orthogonal
V        1        6        2004-09-14 19:28:00        andrevan
V        1        7        2004-09-14 19:37:00        texture
V        1        8        2004-09-14 21:04:00        lst27
V        1        9        2004-09-14 21:30:00        mirv
V        1        10        2004-09-14 22:13:00        anárion
V        0        26        2004-09-14 22:18:00        grunt
V        0        27        2004-09-15 03:19:00        slowking
V        0        28        2004-09-15 03:20:00        neutrality
V        1        11        2004-09-15 04:28:00        merovingian
V        1        12        2004-09-15 06:56:00        wile
V        1        13        2004-09-15 09:19:00        sjc
V        1        14        2004-09-15 12:20:00        172
V        0        29        2004-09-16 00:58:00        ugen64
V        1        15        2004-09-16 14:50:00        danny
V        1        16        2004-09-16 15:31:00        simonp
V        1        17        2004-09-17 13:49:00        jwrosenzweig
V        1        18        2004-09-17 20:57:00        adam
V        1        19        2004-09-17 22:11:00        ffirehorse
V        1        20        2004-09-18 00:02:00        michael
V        1        21        2004-09-18 01:06:00        rhymeless
V        1        22        2004-09-20 05:36:00        bearcat
V        1        23        2004-09-20 14:28:00        cryptoderk
V        1        24        2004-09-20 22:20:00        jayjg

E        1
T        2004-09-21 20:49:47
U        54        zoney
N        28        neutrality
V        1        28        2004-09-14 13:39:00        neutrality
V        1        33        2004-09-14 13:41:00        chmod007
V        1        34        2004-09-14 14:40:00        norm
V        1        5        2004-09-14 15:00:00        orthogonal
V        1        20        2004-09-14 15:43:00        michael
V        1        36        2004-09-14 16:02:00        antandrus
V        1        3        2004-09-14 16:38:00        ludraman
V        1        25        2004-09-14 16:50:00        blankfaze
V        1        35        2004-09-14 16:53:00        func
V        1        6        2004-09-14 19:28:00        andrevan
V        1        37        2004-09-14 19:29:00        conti
V        1        7        2004-09-14 19:40:00        texture
V        1        38        2004-09-14 19:59:00        arminius
V        1        8        2004-09-14 21:04:00        lst27
V        1        39        2004-09-14 21:15:00        squash
V        1        40        2004-09-14 21:20:00        kate
V        1        9        2004-09-14 21:30:00        mirv
V        1        10        2004-09-14 22:13:00        anárion
V        1        26        2004-09-14 22:15:00        grunt
V        1        41        2004-09-14 23:59:00        acegikmo1
V        1        11        2004-09-15 04:28:00        merovingian
V        1        42        2004-09-15 04:34:00        jfdwolff
V        1        14        2004-09-15 12:19:00        172
V        1        43        2004-09-15 23:11:00        gtrmp
V        1        44        2004-09-15 23:18:00        morven
V        1        45        2004-09-15 23:33:00        avnative
V        1        46        2004-09-16 00:19:00        tuf-kat
V        1        47        2004-09-16 10:28:00        rebecca
V        1        48        2004-09-16 10:39:00        noisy
V        1        15        2004-09-16 14:51:00        danny
V        1        17        2004-09-16 21:59:00        jwrosenzweig
V        1        49        2004-09-17 01:37:00        markalexander100
V        1        50        2004-09-17 10:47:00        benc
V        1        19        2004-09-17 22:12:00        ffirehorse
V        1        51        2004-09-17 22:53:00        austin
V        1        21        2004-09-18 01:07:00        rhymeless
V        1        52        2004-09-18 02:10:00        cyopardi
V        1        53        2004-09-20 15:56:00        kevin
V        1        24        2004-09-20 22:21:00        jayjg
V        1        29        2004-09-21 00:55:00        ugen64



现在有这么一个格式是这样的txt文档,是关于wiki百管理员投票的,请问根据这样的数据(大概7000条左右),如和构造一个数据库,或者说如何能把这些数据合理的读到mysql表格中,用PHP能实现吗?感觉解答!
分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友 微信微信
收藏收藏 分享淘帖 顶 踩
2#
发表于 2014-4-23 09:43:11 | 只看该作者
用SQLyog或navicat工具啊。
您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|申请友链|小黑屋|Archiver|手机版|MySQL社区 ( 京ICP备07012489号   
联系人:周生; 联系电话:13911732319

GMT+8, 2024-6-24 20:56 , Processed in 0.078690 second(s), 23 queries , Gzip On.

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表