Created
December 26, 2021 06:51
-
-
Save froop/6d53bc9cc973b24436e37a35d62ae186 to your computer and use it in GitHub Desktop.
[Python] 正規表現サンプル
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import re | |
with open('/content/drive/MyDrive/input.tsv') as file: | |
for line in file: | |
res = re.match('^([^\t]+)\t([^\t]+)\t.{3}([^\t]+)\t([^\t]+)$', line) | |
print('%s\t%s\t%s' % (res.group(2), res.group(4), bytes.fromhex(res.group(3)))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment