Repository navigation
Expand file tree
/
Copy pathloop.rb
More file actions
97 lines (55 loc) · 1.46 KB
/
Copy pathloop.rb
File metadata and controls
97 lines (55 loc) · 1.46 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
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
book = CSV.open("file22.csv", "wb", headers:true)
# puts lines[0]
auto = []
b = []
average = Array.new
print_time_spent do
auto = []
cc = []
CSV.foreach('ggg.csv', headers:true) do |row|
auto = row['Phoneday'].gsub(/\D/, '')
blue = row
# auto.push(row['Car make'])
if a.any? {|word| word == auto}
else
cc.push(blue)
end
#puts row['Car make']
end
puts cc
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