Skip to content

Instantly share code, notes, and snippets.

@MattOates
Created September 10, 2015 16:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MattOates/24fe1f212be1ad09fd96 to your computer and use it in GitHub Desktop.
Save MattOates/24fe1f212be1ad09fd96 to your computer and use it in GitHub Desktop.
Chomp files code
#!/usr/bin/env perl6
for 'data.tsv'.IO.lines {}
#!/usr/bin/env perl
open my $file, '<', 'data.tsv';
while (<$file>) { chomp }
#!/usr/bin/env python
for line in open('fata.tsv'):
line.rstrip('\n')
#!/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