Skip to content

Instantly share code, notes, and snippets.

@banyan
Created February 18, 2010 17:11
Show Gist options
  • Select an option

  • Save banyan/307850 to your computer and use it in GitHub Desktop.

Select an option

Save banyan/307850 to your computer and use it in GitHub Desktop.
<?php
$array = file("./sample.xml");
foreach ($array as $line) {
echo $line;
}
#-*- 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,
# 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