Don’t forget to tell us about your stack!
OS: Windows 10
Java Version: 25.0.2
Tomcat Version: ???
Lucee Version: 5.2.6.60
Hello,
tmpfile looks like this…
"45482.470431";"Calculated engine load value";"49.80392156862745";"Percent";"27.5056933";"-81.0232583";
"45482.5710498";"Short term fuel Percent trim - Bank 1";"-2.34375";"Percent";"27.5056933";"-81.0232583";
"45482.6726597";"Long term fuel Percent trim - Bank 1";"4.6875";"Percent";"27.5056933";"-81.0232583";
"45482.844328";"Average fuel consumption";"27.30519254276154";"MPG";"27.5056933";"-81.0232583";
I have the following code in a template.
<cfset tmpfile=#ReReplace(tmpfile, '"(\d\d\d\d\d.)(\d\d\d\d)"', "\1\2 000", "ALL")#>
<cfset tmpfile=#ReReplace(tmpfile, '"(\d\d\d\d\d.)(\d\d\d\d\d)"', "\1\2 00", "ALL")#>
<cfset tmpfile=#ReReplace(tmpfile, '"(\d\d\d\d\d.)(\d\d\d\d\d\d)"', "\1\2 0", "ALL")#>
The beginning digits for each line are number of seconds since start. Some of these entries have 4,5 or 6 digits after the period mark. I need them padded with zeroes so that all of these entries are the same length for example 99999.9999999
After lengthy research and trial and error I cannot figure out how to do this without introducing a blank space between the second capture group and the zeroes that need to be append to the end of the string.
How would I do this?
Thanks for any assistance ![]()