Repository navigation
Expand file tree
/
Copy pathloop2.rb
More file actions
120 lines (69 loc) · 1.97 KB
/
Copy pathloop2.rb
File metadata and controls
120 lines (69 loc) · 1.97 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
require 'csv'
require_relative './helpers'
def processText()
f = File.open("ggg.txt")
a = []
File.readlines(f).each do |line|
a.push(line.strip)
end
# .str.each_line.chomp do |line|
# a = f.readlines
# puts a[2]
# puts a[12]
# fileName = file.to_s
# lines = File.open("phone2.txt")
# s = readlines.each do |line|
lineCount = a.size
# puts lines[0]
auto = []
b = []
average = Array.new
print_time_spent do
auto = []
#cc = CSV.table('ggg.csv', headers:true)
# x.delete_if { |row| y_rows.include?(row) }
note = []
csv = []
counter = 0
#csv = CSV.foreach('ggg.csv', headers:true) do |row|
# counter += 1
# auto = row['Phoneday'].gsub(/\D/, '')
# puts counter
col_data = []
match = []
csv = CSV.foreach('ggg.csv', headers:true) {|row| col_data << row[18].gsub(/\D/, '')}
# auto.push(row['Car make'])
# if a.any? {|word| word == auto}
# cc.delete(counter)
puts counter
puts col_data.size
col_data.each do |line|
counter += 1
if a.any? {|word| word == line}
# else
match.push(line)
puts counter
else
#puts row['Car make']
end
end
end
# p auto
# loop through a
#p blue
# if a.any? {|word| word == "FORD"}
# puts "FOUND match"
# else
# puts "did not find match"
# end
end
processText()
#file = File.open('phone.txt', 'r')
#file.each_line {|line| puts line}
#puts file.count
x = ["100","124","125","126","127"]
# if x.any? {|word| word == "127"}
# puts "FOUND match"
# else
# puts "did not find match"
# end