Network Automation Software We are currently migrating this forum
over to our HelpSystems domain. Please
post all new threads in our new
HelpSystems Community Portal.
Post to the HelpSystems Forum
You are not currently logged on. You must be logged on in order to post. Log on
Or Create a new account
AutoMate Discussion
Decrease font size
Increase font size
Topic Title: Reading parts of a Text File
Topic Summary: Decimal throws off result
Created On: 10/31/2016 12:10 AM
Status: Read Only
Linear : Threading : Single : Branch
Search Topic Search Topic
Topic Tools Topic Tools
View similar topics View similar topics
View topic in raw text format. Print this topic.
Answer This question was answered by JamesSupancic, on Tuesday, November 1, 2016 8:38 PM

Answer:
That's it! Thank you Gijsberth! And thank you Leonard!
 10/31/2016 12:10 AM
User is offline View Users Profile Print this message

Author Icon
JamesSupancic
Journeyman (50-99)

Posts: 85
Joined: 09/29/2005

I have a string that captures parts of a text file:

%mid(split(InsForm,vbCrLf)(row-1),column,width)%

It captures data exactly form the row, column and width specified EXCEPT if it is a dollar value with a decimal point.

Example:
500.00 is captured as 500

What have I done wrong? I know the region of capture is correct because if I replace the decimal point with an x it works.

500x00 is captured as 500x00

Thanks for your help.

James

 Category Survey
 10/31/2016 12:06 PM
User is offline View Users Profile Print this message

Author Icon
JamesSupancic
Journeyman (50-99)

Posts: 85
Joined: 09/29/2005

I can grab the dollars and cents separately. The problem is I can not join the 2 variables. They are part of a loop, where "i" is the loop count.

Fee%i% = Dollar%i%.Cents%i%

I have tried multiple combinations with parentheses.

%Dollar(%i%).%Cents(%i%)%
(%Dollar%i%%).(%Cents%i%%)

Any idea on how to join 2 variables that are both part of a loop count?

Thanks for your help! James

 Category Survey



Task Steps: (Right click, Select All, Copy to copy to the clipboard. Steps can then be pasted into the AutoMate Task Builder)
 10/31/2016 02:34 PM
User is offline View Users Profile Print this message

Author Icon
Leonard Amabile
HelpSystems

Posts: 5454
Joined: 05/15/2007

James,

I'm not sure how you are incorporateing the %i% into the dollar and cent values. Please review my code below and let me know if this helps.

 Category Survey
AutoMate 9 version:
Windows version:



Task Steps: (Right click, Select All, Copy to copy to the clipboard. Steps can then be pasted into the AutoMate Task Builder)


-------------------------

Leonard Amabile | Director, Cross Platform Support
AutoMate | InterMapper | Skybot | Divisions of HelpSystems
T: +1.213.738.1700 | F: +1.213.738.7665
 10/31/2016 07:52 PM
User is offline View Users Profile Print this message

Author Icon
JamesSupancic
Journeyman (50-99)

Posts: 85
Joined: 09/29/2005

Thank you Leonard. Your code helped. I don't think it is possible to combine 2 variables with an "i" increment number in a loop. After the variables are defined, I realized the variables are combining, but my message box did not display the decimal values if they were zero. So...

500.00 is being displayed as 500
550.01 is being displayed as 500.01

So, it appears they are combining, but the zero values are not showing.

The problem I am having is when I try to add two variables. I can add 2 + 2, and the variable is set to 4.

Set %TFee%
2 + 2
and TFee shows 4.

If I set %TFee% to
%Doller1%.%Cent1% + %Doller2%.%Cent2%
the TFee showes 500.01 + 500

It does not actually add them up.

What am I doing wrong?

Thanks for your help, James

 Category Survey
 11/01/2016 04:16 AM
User is offline View Users Profile Print this message

Author Icon
Gijsberth de Ruiter
Artisan (200-499)

Posts: 455
Joined: 03/30/2005

James,
I think that your problem is that the variable is set to a 'number' and thus are .00 not shown. You could try to set the variable to 'text' instead of 'number'.

 Category Survey



Task Steps: (Right click, Select All, Copy to copy to the clipboard. Steps can then be pasted into the AutoMate Task Builder)


-------------------------
I am an A-Team Member
 11/01/2016 08:38 PM
User is offline View Users Profile Print this message

Author Icon
JamesSupancic
Journeyman (50-99)

Posts: 85
Joined: 09/29/2005

Answer Answer
That's it! Thank you Gijsberth! And thank you Leonard!

 Category Survey
Statistics
18258 users are registered to the AutoMate Discussion forum.
There are currently 0 users logged in.
The most users ever online was 5551 on 01/08/2018 at 11:11 AM.
There are currently 1344 guests browsing this forum, which makes a total of 1344 users using this forum.

FuseTalk Enterprise Edition v4.0 - © 1999-2020 FuseTalk Inc. All rights reserved.

Sitemap Network Automation Software Blog