awk -F^ ' BEGIN { z=0 ;r=1}
z==0 || FILENAME != ant {
if (ant!="") print "" >file
ant=FILENAME 
file=sprintf("IV/%.2d",r++)
print file
print "H0103">file
print "H0203/01/2014">file
print "H03"substr(FILENAME,5)>file
z=0
}
{
printf "D%.2d00%s\n",z,$1>file
printf "D%.2d01%s\n",z,$2>file
printf "D%.2d02%s\n",z,$3>file
printf "D%.2d03%s\n",z,$4>file
printf "D%.2d04%s\n",z,$5>file
printf "D%.2d05%.2f\n",z,$3*$5>file
if (z++ ==39) z=0

}
END {
if (ant!="") print "" >file
}
' IVV/*
>../data/pordr/H
>../data/pordr/HEAD
>../data/pordr/DOC
echo -n "    0     0">../data/pordr/INFO

for i in IV/*
do
../ihd/bin/ihmu pordr ../../import/$i -N1
done
exit
Item Number^SupplierID^Category^Model^Size^Coverfinish^Manufacturer^Group^Description^Cost^Retail^Date Entered^LastPPCUpdate^OrgDescription
1^5^Upholstery^^^<none>^Ashley Softgoods^ADV^<none>^0^9.99^06/09/1997^09/20/2008^<none>
100^5^Dining^1122^buffet hutch^<None>^Ashley Softgoods^Fabric Protection^1122 Buffet Hutch <None>^200^429.99^09/07/2006^11/02/2006^1122 Buffet Hutch <None>
102^9^Occasional Table^4335- top^3-PK Cocktail Set^DARK BROWN^Crown Mark, Inc^^4335- top 3-PK Cocktail Set DARK BROWN^199.95^449.98^09/08/2006^12/12/2006^4335- Top 3-pk Ct-en DARK BROWN
103^9^Occasional Table^4335-LEG^3-PK Cocktail Set^Metal Leg^Crown Mark, Inc^^4335-LEG 3-PK Cocktail Set Metal Leg^200^450.98^09/08/2006^12/12/2006^4335-LEG 3-pk Ct-en Metal Leg
105^5^Bedroom^B153-31^dresser^Symphony Cherry^Ashley Softgoods^^B153-31 Dresser Symphony Cherry^140^299.99^09/13/2006^08/18/2007^B153-31 Dresser Symphony Cherry
106^108^Bedding^940097-LILLIE ET^5/0 queen matt^Symphony Cherry^FIVE STAR MATTRESS^^940097-LILLIE ET 5/0 Queen Matt Symphony Cherry^90^229.99^09/13/2006^08/23/2008^940097-LILLIE ET 5/0 Queen Matt Symphony Cherry
107^5^Bedroom^B153-46^Chest^Symphony Cherry^Ashley Softgoods^^B153-46 Chest Symphony Cherry^116^249.99^09/13/2006^03/26/2007^B153-46 Chest Symphony Cherry
108^110^Bedroom^B153-54^Qn/ftbd/rails^Symphony Cherry^Misc^^B153-54 Qn/ftbd/rails Symphony Cherry^80^160^09/13/2006^10/10/2013^B153-54 Qn/ftbd/rails Symphony Cherry
109^5^Bedroom^B153-57^Qn/hdbd^Symphony Cerry^Ashley Softgoods^^B153-57 Qn/hdbd Symphony Cerry^53.99^119.99^09/13/2006^03/26/2007^B153-57 Qn/hdbd Symphony Cerry

