okweiteng 2015-11-10 08:42 采纳率: 40%
浏览 1585

用Python对数据格式进行处理

Id: 0
ASIN: 0771044445
discontinued product

Id: 1
ASIN: 0827229534
title: Patterns of Preaching: A Sermon Sampler
group: Book
salesrank: 396585
similar: 5 0804215715 156101074X 0687023955 0687074231 082721619X
categories: 2
|Books[283155]|Subjects[1000]|Religion & Spirituality[22]|Christianity[12290]|Clergy[12360]|Preaching[12368]
|Books[283155]|Subjects[1000]|Religion & Spirituality[22]|Christianity[12290]|Clergy[12360]|Sermons[12370]
reviews: total: 2 downloaded: 2 avg rating: 5
2000-7-28 cutomer: A2JW67OY8U6HHK rating: 5 votes: 10 helpful: 9
2003-12-14 cutomer: A2VE83MZF98ITY rating: 5 votes: 6 helpful: 5

Id: 2
ASIN: 0738700797
title: Candlemas: Feast of Flames
group: Book
salesrank: 168596
similar: 5 0738700827 1567184960 1567182836 0738700525 0738700940
categories: 2
|Books[283155]|Subjects[1000]|Religion & Spirituality[22]|Earth-Based Religions[12472]|Wicca[12484]
|Books[283155]|Subjects[1000]|Religion & Spirituality[22]|Earth-Based Religions[12472]|Witchcraft[12486]
reviews: total: 12 downloaded: 12 avg rating: 4.5
2001-12-16 cutomer: A11NCO6YTE4BTJ rating: 5 votes: 5 helpful: 4
2002-1-7 cutomer: A9CQ3PLRNIR83 rating: 4 votes: 5 helpful: 5
2002-1-24 cutomer: A13SG9ACZ9O5IM rating: 5 votes: 8 helpful: 8
2002-1-28 cutomer: A1BDAI6VEYMAZA rating: 5 votes: 4 helpful: 4
原数据格式如上,存在m.txt中,我想得到的格式如下:
Id: 1 cutomer: A2JW67OY8U6HHK rating: 5 votes: 10 helpful: 9
Id: 1 cutomer: A2VE83MZF98ITY rating: 5 votes: 6 helpful: 5
Id: 2 cutomer: A11NCO6YTE4BTJ rating: 5 votes: 5 helpful: 4
Id: 2 cutomer: A9CQ3PLRNIR83 rating: 4 votes: 5 helpful: 5
Id: 2 cutomer: A13SG9ACZ9O5IM rating: 5 votes: 8 helpful: 8
Id: 2 cutomer: A1BDAI6VEYMAZA rating: 5 votes: 4 helpful: 4
用Python程序怎么写?求具体代码,谢谢!

  • 写回答

4条回答 默认 最新

  • 水的只能学 2015-11-10 10:05
    关注

    你给这些数据真心没看明白有什么规律。。。所以你所说的处理也就不明白了

    评论

报告相同问题?

悬赏问题

  • ¥20 双层网络上信息-疾病传播
  • ¥50 paddlepaddle pinn
  • ¥20 idea运行测试代码报错问题
  • ¥15 网络监控:网络故障告警通知
  • ¥15 django项目运行报编码错误
  • ¥15 请问这个是什么意思?
  • ¥15 STM32驱动继电器
  • ¥15 Windows server update services
  • ¥15 关于#c语言#的问题:我现在在做一个墨水屏设计,2.9英寸的小屏怎么换4.2英寸大屏
  • ¥15 模糊pid与pid仿真结果几乎一样