需要帮助将文本转换为csv格式 [英] Need help converting text to csv format
问题描述
。我找到了一个很好的资源但需要帮助格式化
文本数据,以便我可以将它导入到mysql数据库中。这是
数据格式:
409220000003 Life Fitness Products $ 1(12-13-08)(CVS)
546500181141 Oust Air Sanitizer,任意B1G1F最高$ 3.49(1-17-09).35
518000159258 Pillsbury Crescent晚餐卷,任意.25(2-14) -09)
518000550406 Pillsbury冷冻大饼干,肉桂卷,迷你
肉桂卷等.40(2-14-09)
>
第一个值(大数字)是UPC,下一个元素是
优惠券描述,后面是括号中的日期。这些只是我关心的三个元素。
。有人可以帮我吗
重新格式化:
409220000003 Life Fitness Products $ 1(12-13-08)(CVS)
546500181141 Oust Air Sanitizer,任意B1G1F最高$ 3.49(1-17-09).35
518000159258 Pillsbury Crescent晚餐卷,任意.25(2-14) -09)
518000550406 Pillsbury冷冻大饼干,肉桂卷,迷你
肉桂卷等.40(2-14-09)
>
就像这样:
" 409220000003"," Life Fitness Products $ 1"" 12-13-08"
546500181141,Oust Air Sanitizer,任何B1G1F最高$ 3.49,1-17-09
" 518000159258",Pillsbury Crescent晚餐卷,任何.25"," 2-14-09"
" 518000550406",Pillsbury Frozen Grands Biscuits,Cinnamon Rolls,Mini
肉桂卷等。 40"," 2-14-09"
任何帮助,伪代码或任何pu在正确的方向sh将
最受赞赏。我是一名新手Python程序员,但我确实有一个很好的PHP编程经验。
感谢您的时间....
1(12-13-08)(CVS)
546500181141 Oust Air Sanitizer,任何B1G1F最高
< br>
3.49(1-17-09).35
每个
518000159258 Pillsbury Crescent晚餐卷,任何.25(2-14-09)
518000550406 Pillsbury冷冻大饼干,肉桂卷,迷你
肉桂卷等.40(2-14-09)
第一个值(大数字)是UPC,下一个元素是
优惠券描述,后面是括号中的日期。这些只是我关心的三个元素。
。有人可以帮我吗
重新格式化:
409220000003 Life Fitness Products
1(12-13-08 )(CVS)
546500181141 Oust Air Sanitizer,任何B1G1F最高
Hey guys. I''m working on a little program to help my wife catalog her/
our coupons. I found a good resource but need help formatting the
text data so that I can import it into a mysql database. Here''s the
data format:
409220000003 Life Fitness Products $1 (12-13-08) (CVS)
546500181141 Oust Air Sanitizer, any B1G1F up to $3.49 (1-17-09) .35
each
518000159258 Pillsbury Crescent Dinner Rolls, any .25 (2-14-09)
518000550406 Pillsbury Frozen Grands Biscuits, Cinnamon Rolls, Mini
Cinnamon Rolls, etc. .40 (2-14-09)
The first value (large number) is the UPC, the next element is the
coupon description, followed by a date in parenthesis. Those are the
only three elements I am concerned with. Can someone help me in
reformatting this:
409220000003 Life Fitness Products $1 (12-13-08) (CVS)
546500181141 Oust Air Sanitizer, any B1G1F up to $3.49 (1-17-09) .35
each
518000159258 Pillsbury Crescent Dinner Rolls, any .25 (2-14-09)
518000550406 Pillsbury Frozen Grands Biscuits, Cinnamon Rolls, Mini
Cinnamon Rolls, etc. .40 (2-14-09)
into something like this:
"409220000003","Life Fitness Products $1","12-13-08"
"546500181141","Oust Air Sanitizer, any B1G1F up to $3.49","1-17-09"
"518000159258","Pillsbury Crescent Dinner Rolls, any .25","2-14-09"
"518000550406","Pillsbury Frozen Grands Biscuits, Cinnamon Rolls, Mini
Cinnamon Rolls, etc. .40","2-14-09"
Any help, pseudo code, or whatever push in the right direction would
be most appreciated. I am a novice Python programmer but I do have a
good bit of PHP programming experience.
Thanks for your time....
1 (12-13-08) (CVS)
546500181141 Oust Air Sanitizer, any B1G1F up to
3.49 (1-17-09) .35
each
518000159258 Pillsbury Crescent Dinner Rolls, any .25 (2-14-09)
518000550406 Pillsbury Frozen Grands Biscuits, Cinnamon Rolls, Mini
Cinnamon Rolls, etc. .40 (2-14-09)
The first value (large number) is the UPC, the next element is the
coupon description, followed by a date in parenthesis. Those are the
only three elements I am concerned with. Can someone help me in
reformatting this:
409220000003 Life Fitness Products
1 (12-13-08) (CVS)
546500181141 Oust Air Sanitizer, any B1G1F up to
这篇关于需要帮助将文本转换为csv格式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!