I want to be able to paste the tab-delimited data (shown below) into a multi-line text box.
Data:
Fat 119.3g 62.1%
Saturated Fat 26.4g
Cholesterol 442.5mg
Sodium 3,824.8mg
Carbohydrates 80.1g 18.5%
Fiber 12.1g
Sugars 26.6g
Protein 83.7g 19.4%
NOTE: Each row is: [nutrient name][tab][g/mg amount][tab][% (only on 3)]
When I click a button, I would like the following to happen:
fatInput.text = "119.3"
satfatInput.text = "26.4"
cholesteralInput.text = "442.5"
sodiumInput.text = "3824.8"
carbInput.text = "80.1"
fiberInput.text = "12.1"
sugarInput.text = "26.6"
proteinInput.text = "83.7"
So to summarize, it pulls those numbers out of the textbox I pasted it into and enters them into the separate textboxes. Commas, "g" and "mg" should not be included. The three percentages are not relevant and may be ignored. The nutrient names, order, and tabs do not change.
Is this even possible?!
THANKS FOR THE HELP!!!
Disclaimer: Not a programmer, just have basic knowledge and thought of a fun program to make to help me track what I eat. I've completed the program but decided to enhance it with the below so I don't have to manually type in these numbers. If this is too complicated I don't need the answer, just some direction and I can figure it out. I have no clue where to start!