mirror of
https://github.com/FranP-code/public-apis.git
synced 2025-10-13 00:03:04 +00:00
Skip schema lines and split lines by pipe-char
This commit is contained in:
@@ -1,9 +1,20 @@
|
||||
#!/usr/bin/env ruby
|
||||
|
||||
args = ARGV
|
||||
filename = args[0]
|
||||
|
||||
File.foreach(filename).with_index do |line, line_num|
|
||||
line_num += 1
|
||||
puts "#{line_num}: #{line}"
|
||||
# puts "#{line_num}: #{line}"
|
||||
if line.start_with?('|')
|
||||
# Skip table schema lines
|
||||
if line.eql? "|---|---|---|---|---|\n"
|
||||
next
|
||||
end
|
||||
|
||||
values = line.split("|")
|
||||
values.each.with_index do |v, vn|
|
||||
puts "#{vn}: #{v}"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user