File tree 1 file changed +27
-6
lines changed
1 file changed +27
-6
lines changed Original file line number Diff line number Diff line change 6
6
7
7
8
8
# read the file
9
+ # code_map = <<END_CODE
10
+ # Case/card # cols 1-4
11
+ # Card Start Width Items Total Variable
12
+ # No. Col. Cols.
13
+ # END_CODE
9
14
10
15
FasterCSV . foreach ( CSV_FILE_PATH , :headers => true , :header_converters => :symbol ) do |line |
11
- for n in 1 ..15
12
- p line [ n ]
16
+ ascii = line [ :id ] + ' '
17
+ code_map = ""
18
+ start_col = 6
19
+ item = 1
20
+ for n in 1 ..16
21
+ if line [ n ]
22
+
23
+ line [ n ] . split ( "|" ) . each { |unit | ascii += unit }
24
+
25
+
26
+ ascii += line [ n ]
27
+ start_col += line [ n -1 ] . length * item unless n == 1
28
+ item if line [ n ] . split ( "|" , )
29
+ #code_map += line[:id] +" " + start_col.to_s + " " + line[n].length.to_s + " " + item.to_s + line[:header] + '\n'
30
+ end
13
31
end
14
-
15
- p line [ :id ] + " " + line [ :q1 ] + line [ :q2 ] + line [ :q3 ] + line [ :q4 ] + line [ :q5 ] + line [ :q6 ]
32
+ p ascii
33
+ p code_map
34
+ p start_col
16
35
17
- end
18
-
36
+ end
37
+
38
+
39
+
19
40
# DATA = File.read(CSV_FILE_PATH)
20
41
#
21
42
# table = FCSV.parse(DATA, :headers => true, :header_converters => :symbol)
You can’t perform that action at this time.
0 commit comments