This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'progress_bar' | |
# Extends CSV class to include progress bar enhancement | |
class CSV | |
module ProgressBar | |
def progress_bar | |
::ProgressBar.new(@io.size, :bar, :counter, :percentage, :elapsed, :eta) | |
end | |
def each |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
find . -mindepth 2 -type f -print -exec mv {} . \; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Mixed with CASE, this will extract the float/digits in the last set of `()` in the string | |
CASE WHEN string_to_chop LIKE '%(%-%)%' THEN | |
NULL | |
ELSE | |
NULLIF (REPLACE(REPLACE(REGEXP_SUBSTR (string_to_chop, '\\([[:digit:]]+.[[:digit:]]+\\)$|\\([[:digit:]]+\\)$'), '(', ''), ')', ''), '')::float | |
END AS chopped_string |