Don
I am calculating volumes based on concentrations. Here, I am "translating" a file that is being generated by one documentation system into a CSV file that will be understood by a robotic unit. The controllers are Windows based boxes (connected by a LAN cable). The idea is to have a BATCH file that will automatically translate and feed the CSV file into the computer controlling the robotic unit
The minimum file will contain a number that will change from run to run -the user will not have access to that file. Something like this:
2.0
I am outputting that number using the following script:
gawk '{ print $1}' C:\minimum.txt"
I am using the above script to defince variable est
gawk -v "est=gawk '{ print $1}' C:\minimum.txt"
The rest of my code divides the data generated by the documentation system and multiplies it for a constant ( 15
), printing the original concentration value
and the calculated volume
'{ calc=( est / $2)*15 } {print $2, calc}' C:\cygwin64\User\Output.txt > C:\cygwin64\User\Output2.txt
The Output
file contains hundreds of entries and looks like this:
The Output2
file should look like this:
4.58 6.55022
2.57 11.6732
5.56 5.39568
3.58 8.37989
3.22 9.31677
3.09 9.70874
3.27 9.17431
2.46 12.1951
2.55 11.7647
2.31 12.987
3.85 7.79221
2.62 11.4504
2.76 10.8696
2.06 14.5631
2.69 11.1524
PS. I could do it with not many issues in CygWin but using BATCH will be much easier. Fetching the variable from the minimum
file and inputting it in my script handling the calculations is the last step. My batch files works like a charm when I enter the actual number:
gawk -v "est=2" '{ calc=( est / $2)*15 } {print $2, calc}' C:\cygwin64\User\Output.txt > C:\cygwin64\User\Output2.txt
I am restricted to what CMD allows me to do. I cannot use bash or any other unix approach for this particular task
Thanks in advance for any help tackling this issue