Created
February 18, 2010 17:11
-
-
Save banyan/307850 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| <?php | |
| $array = file("./sample.xml"); | |
| foreach ($array as $line) { | |
| echo $line; | |
| } |
This file contains hidden or 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
| #-*- coding: utf-8 -*- | |
| import os | |
| file_name = 'sample.csv' | |
| if os.access(file_name, os.R_OK): | |
| for row in open(file_name, 'r'): | |
| print row, |
This file contains hidden or 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
| # encoding: utf-8 | |
| file_name = './sample.xml' | |
| File.readlines(file_name).each do |line| | |
| p line.chomp | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment