What I want to do is grab all invoice files in the pwd and cut two of the fields. One of the field designates the manufacturer which I will need to create the unique file. The second field I will copy to the file that is uniquely named by its manufacturer, call it a car.
First call the files in the pwd.
for i in `cat *inv`
Read the fields.
echo $i | cut -d"|" -f2 | read x
echo $i | cut -d"|" -f4 | read y
Conditional statement based upon the input in $x. Copy field 4 from var $Y to unique file based on list.
if [$x = 1='GM', 2='Ford', 3='Dodge']
echo $y && >> $x
This maybe a mess and is way far from where it needs to be, but I am willing to do whatever it takes to get it where it needs to be.
Any help would be much appreciated.