Skip to content

Instantly share code, notes, and snippets.

@ch4nd4n
Created November 28, 2012 11:23
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 ch4nd4n/4160587 to your computer and use it in GitHub Desktop.
Save ch4nd4n/4160587 to your computer and use it in GitHub Desktop.
File Write Example
pdf_file = File.open("in.txt") # here in.txt is the input file that you want to read
output_file = File.open("out.txt", "w")
pdf_file.readlines.each do |l|
output_file.puts(l)
end
output_file.close
pdf_file.close
Some text in file
Another line of text
1. Line 1
2. Not really line 2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment