#!/bin/sh # #This is the shell script that when run in the same directory with #the unzipped whole database files, will create NUT's input #file "sr19.nut"; header files that describe the data, nut.h, nutrient.h, #and lookup.h; and the library of serving sizes WEIGHT.lib. # rm /tmp/dbjoin* >/dev/null 2>&1 preprocess/dbjoinweight [ ! -e /tmp/dbjoin ] && preprocess/dbjoinnuts preprocess/dbjoinheaders join -j 1 -t'^' /tmp/dbjoin /tmp/dbjoinweight | sort | tr -d "\r" | sed -e "s/\^0\^/\^\^/g" | sed -e "s/\^0\^/\^\^/g" | sed -e "s/\^0\.0\^/\^\^/g" | sed -e "s/\^0\.0\^/\^\^/g" | sed -e "s/\^0\.00\^/\^\^/g" | sed -e "s/\^0\.00\^/\^\^/g" | sed -e "s/\^0\.000\^/\^\^/g" | sed -e "s/\^0\.000\^/\^\^/g" > raw.data/sr20.nut rm /tmp/dbjoin* >/dev/null 2>&1