linux - Compare fraction values present in a text file and outputting it based on a criteria -


i have temp.txt file having contents shown when cat temp.txt used

0.3

1.3

5.3

7.3

they in string format need compare using arithmetic operators

is possible read every line txt file , compare fixed number (lets 5.7). if criteria met need echo out terminal saying "well number bigger thresold " , output txt file.

edit: hope clarifies

awk '{      if ($1 > 5.7)         print "number " $1 " larger 5.7" }' temp.txt | tee output_file.txt 

if need threshold determined dynamically can pass argument awk (google how this).

edit: new format specified op

sed 's/.*>\(.*\)<.*/\1/' temp.txt | sed '/^<[^>]*>/d' $awk '{      if ($1 > 5.7)         print "number " $1 " larger 5.7" }' | tee output_file.txt 

Comments

Popular posts from this blog

java - Oracle EBS .ClassNotFoundException: oracle.apps.fnd.formsClient.FormsLauncher.class ERROR -

c# - how to use buttonedit in devexpress gridcontrol -

nvd3.js - angularjs-nvd3-directives setting color in legend as well as in chart elements -