Created
March 3, 2017 13:26
-
-
Save mzaini30/2ebd6bdbe2c9187869d4401692ad7d8a to your computer and use it in GitHub Desktop.
Mengubah 2 spasi menjadi 1 tab
This file contains 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 | |
lokasi = "/sdcard/python/regex tab/" | |
with open(lokasi+"/input.txt", "r") as file_input,\ | |
open(lokasi+"/output.txt", "w") as file_output: | |
file_input = file_input.read() | |
file_input = re.sub(r" ", r"\t", file_input) | |
file_output.write(file_input) | |
print "done" |
This file contains 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
1. hdggsgdgsg | |
gegsggdgsvve | |
shebvsgsggd | |
2. hdggsgdvvdvsv | |
gegsggsgvsvd | |
dhshbwvevsv |
This file contains 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
1. hdggsgdgsg | |
gegsggdgsvve | |
shebvsgsggd | |
2. hdggsgdvvdvsv | |
gegsggsgvsvd | |
dhshbwvevsv |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment