Created
November 28, 2012 11:23
-
-
Save ch4nd4n/4160587 to your computer and use it in GitHub Desktop.
File Write Example
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
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 |
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
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