怎样用python写HIve的delimiter: ^A

以下在Python 2.7,MacOS上试过

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
f = open('ctrla.txt', 'w')
f.write('abc')
f.write(u'\u0001')
f.write('35')
f.close()
f = open('ctrla.txt', 'w') f.write('abc') f.write(u'\u0001') f.write('35') f.close()
f = open('ctrla.txt', 'w')
f.write('abc')
f.write(u'\u0001')
f.write('35')
f.close()
vim ctrla.txt

  1 abc^A35

本文链接

Leave a Comment

Your email address will not be published.