CommandLineFu: Create Allegro Export Report

for i in {001..999} ; do a=`find ./$i/Native/ -type f 2>>/dev/null | wc -l` 
&& b=`find ./$i/Text/ -type f 2>>/dev/null/ | wc -l` 
&& c=$(($( wc -l ./Data/loadfile.txt 2>>/dev/null | awk '{ print $1 }')-1)) 
&& echo -n "$i," && echo "$a,$b,$c" ; done

Assumes all Allegro exports are located in the same top level directory, and follow a simple alpha-numeric sequence.

In the future I plan on building a simple script around this that prompts for a top-level directory so it can be run from anywhere on the network.  Additionally, storing the report to a text file and running subsequent calculations to determine any time a line item doesn’t match perfectly between Native, Text and Record count.

Allegro Export FOR loop
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

w

Connecting to %s