rm ES/*
awk  -F"^" ' BEGIN {
}
FILENAME==ARGV[1] { x[$1]=$4" "; next }

x[$1]!="" {
file="ES/B"NR
printf "H01%3.3s\n",$2 > file
print "H02"$3> file
print "H03"substr($4,1,2) > file
print "H04"$5 > file
print "H05"x[$1] > file
print "H0600" > file
print "" >file
 }
 ' Tercerizados.csv ../OLD/TERCE
>../data/terce/H
>../data/terce/HEAD
>../data/terce/DOC
echo -n "    0     0">../data/terce/INFO

for i in ES/*
do
../ihd/bin/ihmu terce ../../import/$i -N1
done
exit
MATERIALES^^ABRAZADERA RANGO 900-950MM^CU^48350^08/29/2013
MATERIALES^^ABRAZADERAS FIERRO 10CMS DIAM.^CU^11500^12/14/2016
MATERIALES^^ADHESIVO LAMINADO MATE^M^18000^09/17/2014
MATERIALES^^ADHESIVO P/MURO LAM. MATE PG^M2^25000^09/23/2014
MATERIALES^^ALUCOBON COLOR NEGRO 3MM^CM2^1.2^04/18/2018
MATERIALES^^ALUCOBOND 122X244 5MM^CM2^2.2^04/18/2018
MATERIALES^^ALUCOBOND SILVER 122X244-3MM^CM2^1.2^03/21/2018
MATERIALES^^ALUCOBOND SILVER 3MM^CM2^1.9^07/10/2018
MATERIALES^^ANGULO 30X30X5MM L^CU^1271^08/16/2017
gATERIALES^^APRETADOR PAPELES CLIP 10CMS^CU^848^01/13/2016
