Reputation: 85
some samples of data are here
f = "optimal after sales service. Our customer friendly support system is truly one of a kind giving A Avon Watches a pride of place in the world of Indian watches.\\t0210PBH2YCA\\t1002004\\t499\\t\\t2015-02-10 16:43:27 IST\\t\\ty\\t1\\t\\t\\t11\\t\\t\\t\\tB00TFCNTGG\\t\\t\\t\\t\\t\\tB00TFCNTGG\\t\\t\\t\\tAMAZON_IN\\t\\tMigrated Template\\tActive\\t499.0\\nA Avon Sports Digital Black Dial Men\\\'s watch - 1002008\\tMulti functional Design Watch For Children\\\'s ; Tough Watch Case ; Stainless Steel Back ;Power Battery ; Tab For Date,Month & Multiple Light Effect ; Day & Time Display Together ; Stop Watch ; Calendar ; 12-24 Hour Time Display Option. A Avon Watches are Well known for amazing style and powerful features. The inbuilt features specify their usability. The elegantly designed A Avon Watches are apt to complement formal wear. A Avon Watches built with fine skills is backed by optimal after sales service. Our customer friendly support system is truly one of a kind giving A Avon Watches a pride of place in the world of Indian watches.\\t0216PZ3I06Y\\t1002008\\t499\\t\\t2015-02-16 15:45:58 IST\\t\\ty\\t5\\t\\t\\t11\\t\\t\\t\\tB00TOCAJ4C\\t\\t\\t\\t\\t\\t52E478CC519D7B2D\\t\\t\\t\\tAMAZON_IN\\t\\tMigrated Template\\tActive\\t499.0\\nA Avon Sports Digital Black Dial Women\\\'s Watch - 1002013\\tWatch Design For Children, Boys & Girls. A Avon Watches are Well known for amazing style and powerful features. The inbuilt features specify their usability. The elegantly designed A Avon Watches are apt to complement formal wear. A Avon Watches built with fine skills is backed by optimal after sales service. Our customer friendly support system is truly one of a kind giving A Avon Watches a pride of place in the world of Indian watches.\\t0216PZCK1E4\\t1002013\\t599\\t\\t2015-02-16 18:17:39 IST\\t\\ty\\t5\\t\\t\\t11\\t\\t\\t\\tB00TOGJ00M\\t\\t\\t\\t\\t\\t52E49B861FA1FF25\\t\\t\\t\\tAMAZON_IN\\t\ "
z=f.split("\\\t")
for i in z:
print(i)
print(len(z))
but it is not splitting it is printing same file as it is. I checked the length of z as well it is showing 1.
How to do that?
Upvotes: 0
Views: 38
Reputation: 73480
Your text does not contain any tabs '\t'
so why would a split happen? There are a lot of backslashes \\
followed by a simple t
, yet you try to split on backslashes followed by a tab. You can try:
f.split('\\t')
and see the difference.
Upvotes: 1