Parsing the scientific numbers to general numbers format

I was trying to go down the route of getting multiple lines, one msg per line, and then use a switch node to select the right line and go from there, rather than use a technique that will probably not be fully understood.

Also I believe the requirement is to extract just that one number and ignore the rest.

1 Like

I believe you pressed "reply" too soon, before your computer finished uploading the image.

These are the numbers I want to parse.
F1, 0.1002200000E+003
F2, 0.6450000000E+002
F3, 0.3572000000E+002
F4, 0.6450000000E+002
F5, 0.3572000000E+002
F6, 0.1002200000E+003

F1_D, 0.1690000000E+001
F2_D, -0.5000000000E-001
F3_D, -0.1070000000E+001
F4_D, -0.3000000000E+000
F5_D, 0.7200000000E+000
F6_D, -0.1340000000E+001

@Munier the screenshot you've tried to share has failed to share. Please retry sharing it.

Also, please make it clear if you goal is to get the same text you have, just with the numbers replaced, or if you want to also access the individual values and do something else with them.

My Goal is to reformat

F1, 0.1002200000E+003 to F1, 100.22
F2, 0.6450000000E+002 to F2, 64.500
F3, 0.3572000000E+002 to F3, 35.720
F4, 0.6450000000E+002 to F4, 64.500
F5, 0.3572000000E+002 to F5 35.720
F6, 0.1002200000E+003 to F6, 100.22

F1_D, 0.1690000000E+001 to F1_D, 1.6900
F2_D, -0.5000000000E-001 to F2_D, 0.5000
F3_D, -0.1070000000E+001 to F3_D, 1.0700
F4_D, -0.3000000000E+000 to F4_D, 0.3000
F5_D, 0.7200000000E+000 to F5_D, 0.7200
F6_D, -0.1340000000E+001 to F6_D, 1.3400

Yes, I have some bandwidth issues.

You screenshot shows you have the Function code correct, but it doesn't show where the Function node is in the flow. All I can see is an Inject node connected to a Function node and nothing after that. It looks like it is that Function node you have put this code into.

Does that mean you are injecting the text you want to handle from the Inject node directly?

Or is there still a File node later in the flow?

If the File node comes later in the flow, then how do you imagine the Function node is able to modify the contents if you have put it before the contents of the file is loaded?

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.