Loading ...
Sorry, an error occurred while loading the content.
 

Re: [NTB] Addings numbers in a column with NTS

Expand Messages
  • Jody
    Hi Daniel, ... If there was a tab in your file before you sent it, you can use the Clip below. If there is not a tab between the fields, then in order to use
    Message 1 of 1 , Nov 4, 2001
      Hi Daniel,

      >Is it possible to add numbers in a text file that are in a column
      >using NoteTab Standard? I have a text file that is somewhat like the
      >following:
      >
      >EVENT PROCEEDS ORGANIZER
      >bake sale $423 Sally
      >car wash $124 Robert
      >10 K run $257 Mary

      If there was a tab in your file before you sent it, you can use
      the Clip below. If there is not a tab between the fields, then
      in order to use the Clip below do a Modify | Block | Copy and
      then paste it into a new document. Make sure there is a keyboard
      enter at the end of the document else the last number will not be
      added. The main reason for going through the mess below is
      because NoteTab has a limitation to the amount of operations(?)
      it can do at one time. It seems to be about 40 lines of numbers.
      You can select the "$" in your column if you feel like it. ;)

      <--- Copy below this line --->
      H=Add Field...
      ; Last updated on 06-28-2000

      ^!ClearVariables
      ^!Set %Delimiter%=^?[Enter Delimiter: ^p ^t ";", Tab shown=^p|_^t|^p <TD>^=","]
      ^!Set %Field%=^?[Add what field=_1|2|3|4|5|6|7|8|9]; %CurCur%=^$GetRow$:^$GetCol$
      ^!SetDelimiter ^%Delimiter%
      ^!SetHintInfo Getting field...
      ^!SetScreenUpdate Off

      :Loop
      ^!Set %GrabField%=^$GetField(^$GetRow$;^%Field%)$
      ^!Set %GrabField%=^$StrReplace("$";;"^%GrabField%";0;0)$
      ^!IfFalse ^%FirstPass% FirstPass
      ^!Set %SubTotal%=+^$Calc(^%GrabField%+^%TotalField%;2)$
      ^!Set %TotalField%=^%SubTotal%
      ^!Append %InLine%=^%GrabField%+
      ^!Append %Col%=^%GrabField%^%nl%
      ^!Jump +1
      ^!If ^$GetRow$ = ^$GetLinecount$ Show
      ^!Goto Loop

      :FirstPass
      ^!Set %TotalField%=^%GrabField%
      ^!Append %InLine%=^%GrabField%+
      ^!Append %Col%=^%GrabField%^%nl%

      :NextRow
      ^!Jump +1
      ^!Set %FirstPass%=1
      ^!Goto Loop

      :Show
      ^!SetCursor ^%CurCur%
      ^!Sound ^$GetSoundPath$Sheerp.wav
      ^!Set %InLine%=^$StrDelete("^%InLine%";^$StrSize("^%InLine%")$;1)$
      ^!Set %TotalField%=^$StrReplace("+";;"^%TotalField%";0;0)$
      ^!Info [L]Total = ^%TotalField%^p^p^%InLine% = ^%TotalField%^p^p^%Col%^%TotalField%

      <--- Copy above this line, right --->
      <--- click over a Library, and --->
      <--- choose "Add from Clipboard" --->

      Happy Clip'n!
      Jody

      http://www.notetab.net

      Subscribe, UnSubscribe, Options
      mailto:Ntb-Clips-Subscribe@yahoogroups.com
      mailto:Ntb-Clips-UnSubscribe@yahoogroups.com
      http://groups.yahoo.com/group/ntb-clips
    Your message has been successfully submitted and would be delivered to recipients shortly.