# Parsing the scientific numbers to general numbers format

**URL:** <https://discourse.nodered.org/t/parsing-the-scientific-numbers-to-general-numbers-format/24005>\
**Category:** General\
**Created:** [1 April 2020 05:19 UTC](https://discourse.nodered.org/t/parsing-the-scientific-numbers-to-general-numbers-format/24005 "2020-04-01T05:19:18Z")\
**Posts on this page:** 10\
**Page:** 2

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [1 April 2020 14:25 UTC](https://discourse.nodered.org/t/parsing-the-scientific-numbers-to-general-numbers-format/24005/21 "2020-04-01T14:25:03Z")

</div>

> [@knolleary](#):
>
> I think you've shown us the file contents enough times to see what you have got.

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.

---

<div class="post-metadata">

**Author:** ![Munier](https://avatars.discourse-cdn.com/v4/letter/m/e99b99/32.png) [@Munier](https://discourse.nodered.org/u/Munier)\
**Post date:** [1 April 2020 14:31 UTC](https://discourse.nodered.org/t/parsing-the-scientific-numbers-to-general-numbers-format/24005/22 "2020-04-01T14:31:02Z")

</div>

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/2/9/2980a52e801cd7f133d49c011da6c8eb6e960308.png)

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [1 April 2020 14:32 UTC](https://discourse.nodered.org/t/parsing-the-scientific-numbers-to-general-numbers-format/24005/23 "2020-04-01T14:32:08Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![afelix](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/afelix/32/9743_2.png) [@afelix](https://discourse.nodered.org/u/afelix)\
**Post date:** [1 April 2020 14:33 UTC](https://discourse.nodered.org/t/parsing-the-scientific-numbers-to-general-numbers-format/24005/24 "2020-04-01T14:33:00Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Munier](https://avatars.discourse-cdn.com/v4/letter/m/e99b99/32.png) [@Munier](https://discourse.nodered.org/u/Munier)\
**Post date:** [1 April 2020 14:34 UTC](https://discourse.nodered.org/t/parsing-the-scientific-numbers-to-general-numbers-format/24005/25 "2020-04-01T14:34:26Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)\
**Post date:** [1 April 2020 14:38 UTC](https://discourse.nodered.org/t/parsing-the-scientific-numbers-to-general-numbers-format/24005/26 "2020-04-01T14:38:10Z")

</div>

@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.

---

<div class="post-metadata">

**Author:** ![Munier](https://avatars.discourse-cdn.com/v4/letter/m/e99b99/32.png) [@Munier](https://discourse.nodered.org/u/Munier)\
**Post date:** [1 April 2020 15:02 UTC](https://discourse.nodered.org/t/parsing-the-scientific-numbers-to-general-numbers-format/24005/27 "2020-04-01T15:02:38Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Munier](https://avatars.discourse-cdn.com/v4/letter/m/e99b99/32.png) [@Munier](https://discourse.nodered.org/u/Munier)\
**Post date:** [1 April 2020 15:04 UTC](https://discourse.nodered.org/t/parsing-the-scientific-numbers-to-general-numbers-format/24005/28 "2020-04-01T15:04:14Z")

</div>

Yes, I have some bandwidth issues.

---

<div class="post-metadata">

**Author:** ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)\
**Post date:** [1 April 2020 15:06 UTC](https://discourse.nodered.org/t/parsing-the-scientific-numbers-to-general-numbers-format/24005/29 "2020-04-01T15:06:59Z")

</div>

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?

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/0/3/03416c58ce3bc091da4127cf7cae6d927094f3cd.png)

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [15 April 2020 15:16 UTC](https://discourse.nodered.org/t/parsing-the-scientific-numbers-to-general-numbers-format/24005/31 "2020-04-15T15:16:22Z")

</div>

Closed on 15 April 2020 15:16 UTC

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

[Previous page](https://discourse.nodered.org/t/parsing-the-scientific-numbers-to-general-numbers-format/24005.md?page=1)
