Last active
July 27, 2016 08:27
-
-
Save jibing57/dd339bd792bb5e1be4deac3b7155326e to your computer and use it in GitHub Desktop.
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
# change file extension | |
input_file="./xxx.log" | |
output_file= "#{input_file.chomp(File.extname(input_file))}.csv" | |
puts "input_file is #{input_file}, output_file is #{output_file}" | |
# get first line of files | |
input_file="./xxx.log" | |
first_line = File.open(src_file, "r") {|f| f.readline} | |
puts "first_line of file[#{input_file}] is #{first_line}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment