icersplicer 0.4.2 → 0.5.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/icersplicer +9 -6
- data/lib/icersplicer.rb +3 -3
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ba2bed10d7fecedf88f2a994375c57942ed2608d
|
4
|
+
data.tar.gz: faa5e49314dab1bf8b69496fa839017f99fbd460
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ac0d1d712a7754f603bbe8b9bad08dc82c94bba1ad3ea4aa05de228aea824d6119d2353932fda423f867cb70c57bee38e3266258efea22aa47d6b57c4eb10477
|
7
|
+
data.tar.gz: 07f072756da7bb2dbdd316e3882ea800698e611c004800d151ccfe55d6e3a9b9aee53dbfb6923978a9e06dceaf7e92bd90bb055d8ccf3e6f492975eb9e033553
|
data/bin/icersplicer
CHANGED
@@ -12,7 +12,7 @@
|
|
12
12
|
# Why: for processing large datasets quickly.
|
13
13
|
########################################################################
|
14
14
|
|
15
|
-
require 'getoptlong'
|
15
|
+
require 'getoptlong'
|
16
16
|
require 'walltime'
|
17
17
|
require 'pp'
|
18
18
|
|
@@ -144,6 +144,7 @@ quietmode = false | @quiet_mode
|
|
144
144
|
|
145
145
|
inputfile = @inputfile
|
146
146
|
outputfile = @outputfile
|
147
|
+
grep = @grep
|
147
148
|
|
148
149
|
if @countlines == true
|
149
150
|
countlines(inputfile)
|
@@ -162,26 +163,27 @@ begin
|
|
162
163
|
n.each_line {|data|
|
163
164
|
data_orig = data.clone
|
164
165
|
if search_and_replace == true
|
165
|
-
data_orig.gsub!("#{search}", "#{replace}")
|
166
166
|
data.gsub!("#{search}", "#{replace}")
|
167
167
|
end
|
168
168
|
unless lineoffset > increment_offset
|
169
169
|
unless linelimit == 0
|
170
170
|
unless increment_limit > linelimit
|
171
|
-
unless instance_variable_defined?("@skipblank") and
|
172
|
-
|
171
|
+
unless instance_variable_defined?("@skipblank") and data_orig.strip == ""
|
172
|
+
if data_orig =~ /#{grep}/
|
173
173
|
print_to_screen(linecounter, text_processor(data), quietmode) unless skip(linecounter)
|
174
174
|
if instance_variable_defined?("@outputfile")
|
175
|
+
data_orig.gsub!("#{search}", "#{replace}")
|
175
176
|
processdata(data_orig, outputfile, quietmode) unless skip(linecounter)
|
176
177
|
end
|
177
178
|
end
|
178
179
|
end
|
179
180
|
end
|
180
181
|
else
|
181
|
-
unless instance_variable_defined?("@skipblank") and
|
182
|
-
|
182
|
+
unless instance_variable_defined?("@skipblank") and data_orig.strip == ""
|
183
|
+
if data_orig =~ /#{grep}/
|
183
184
|
print_to_screen(linecounter, text_processor(data), quietmode) unless skip(linecounter)
|
184
185
|
if instance_variable_defined?("@outputfile")
|
186
|
+
data_orig.gsub!("#{search}", "#{replace}")
|
185
187
|
processdata(data_orig, outputfile, quietmode) unless skip(linecounter)
|
186
188
|
end
|
187
189
|
end
|
@@ -200,3 +202,4 @@ closefile if instance_variable_defined?("@exp")
|
|
200
202
|
stats(inputfile, outputfile)
|
201
203
|
timer.watch('stop')
|
202
204
|
timer.print_stats
|
205
|
+
puts "\e[0m\ "
|
data/lib/icersplicer.rb
CHANGED