splitcsv 0.1.2 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0afa9840aef4bf7f83ea14e82374cef5d8bf56e1
4
- data.tar.gz: 5850351d69e24212513e5daeac10bfb0dc03c0d4
3
+ metadata.gz: 38e915baa8d22cd2096376c73e16a96b4f8ff416
4
+ data.tar.gz: c562104344ac1b0b67c94bdae27a8d02d188ae0a
5
5
  SHA512:
6
- metadata.gz: 49bc9a0f43c2b96f22ce536b829efd2f086b6d36377ba2f0a9640f84d2d53b66532326124b38ec1f23b585a0838105a19df1da8cc77888da4c798ee86ff97e28
7
- data.tar.gz: 5c2242bc7952d4c329aa12c31089d2621cd54f5397004a9a3998ee1562cf5a4ba45580caf89cd37e5de8e78c4eaa1e6555d95ef2f651787243b2b6185dd2c5cb
6
+ metadata.gz: 1fbcfa25704e2d29d638c58f44aad3a8ec8f7e574544ac112fc6951c0e2c3efba1af99c5db23fa8ecb8e203b6e34a69cdf6394ea0b3146f42026471bc2e86eca
7
+ data.tar.gz: bad45f3fd597ff5cfd9989d5fc3db9f2050909bbad2a06956b1eed94aac58cad499b62dbe366e06966c057f7a3ce7a42d6dcbe8789f9dce42bd1767508e0ecde
@@ -8,7 +8,7 @@ module SplitCSV
8
8
  csv_dir = File.dirname(csv_path)
9
9
 
10
10
  csv_obj = CSV.open(csv_path, :row_sep => :auto, :col_sep => separator)
11
- csv_length = csv_obj.readlines.size
11
+ csv_length = csv_obj.readlines.size - 1;
12
12
 
13
13
  # Opnieuw inlezen zodat readline pointer terug aan 0 staat. Na gebruiken van
14
14
  # csv_obj.readlines.size werd "csv_obj" al eens volledig doorlopen
@@ -16,10 +16,12 @@ module SplitCSV
16
16
  firstline = csv_obj.readline
17
17
 
18
18
  for i in 0..((csv_length / maxlength.to_i).ceil) do
19
+ puts i
20
+
19
21
  CSV.open("#{csv_dir}/#{csv_basename}_#{i+1}.csv", 'w', :row_sep => :auto, :col_sep => separator) do |csv|
20
22
  csv << firstline
21
23
 
22
- for j in 0..maxlength.to_i do
24
+ for j in 1..maxlength.to_i do
23
25
  if (line = csv_obj.readline) != nil
24
26
  csv << line
25
27
  end
@@ -1,3 +1,3 @@
1
1
  module Splitcsv
2
- VERSION = "0.1.2"
2
+ VERSION = "0.1.3"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: splitcsv
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bert Devriese