Created
September 10, 2015 16:17
-
-
Save MattOates/24fe1f212be1ad09fd96 to your computer and use it in GitHub Desktop.
Chomp files code
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
#!/usr/bin/env perl6 | |
for 'data.tsv'.IO.lines {} |
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
#!/usr/bin/env perl | |
open my $file, '<', 'data.tsv'; | |
while (<$file>) { chomp } |
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
#!/usr/bin/env python | |
for line in open('fata.tsv'): | |
line.rstrip('\n') |
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
#!/usr/bin/env ruby | |
file = File.open('data.tsv') | |
file.each_line do |line| | |
line.chomp | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment