File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 66
77
88# 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
914
1015FasterCSV . 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
1331 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
1635
17- end
18-
36+ end
37+
38+
39+
1940# DATA = File.read(CSV_FILE_PATH)
2041#
2142# table = FCSV.parse(DATA, :headers => true, :header_converters => :symbol)
You can’t perform that action at this time.
0 commit comments