and spit all that back out to another file, can anyone help me with that syntax, I
want to do something like (I know this wont't work)
cat inputfilename | bc (( $input * 0.123 / 0.321 ) + 13 ) > outputfilename
thnx
regards,
Mitch
(sed -e 's/^.*$/a += &/' ifile; echo '((a * 0.123 / 0.321 ) + 13 )') | \
bc > ofile
or
sed -e 's/^.*$/((& * 0.123 \/ 0.321 ) + 13 )/' inputfilename | \
bc > outputfilename
Depending on if you want to do the calculation on the sum of the lines
in the input file or on each line in the file.
Only guessing on the format of your input, of course.
Also you may want to specify precision:
(echo 'scale=3; sed -e 's/^.*$/((& * 0.123 / 0.321 ) + 13 )/' ifile) | \
bc > ofile
----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups
----= East and West-Coast Server Farms - Total Privacy via Encryption =----