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

Re: Selecting and deleting portions of files

Expand Messages
  • Mark Partous
    Hello hugo_paulissen, Friday, April 25, 2003, 1:19:54 PM, you wrote: h Alan, Mark, h Apparently the reason why my clip didn t work had to do with the h
    Message 1 of 13 , May 1, 2003
    • 0 Attachment
      Hello hugo_paulissen,

      Friday, April 25, 2003, 1:19:54 PM, you wrote:

      h> Alan, Mark,

      h> Apparently the reason why my clip didn't work had to do with the
      h> original mail being treated by Yahoo/the web. I have a slightly
      h> different clip that should do what Mark wants it to do. (changed the
      h> regular expressions and searches a little further now, since the text
      h> Mark provided us with now was different from the first post..

      h> Hugo

      h> Look out for long lines (like the one with ===etc)

      h> ;^!SetDebug ON
      h> ^!Jump 1
      h> ^!Set %output%=""
      h> :LOOP
      h> ^!Find "\s+-+\n.+\n\s+-+" RS
      h> ^!IfError END
      h> ^!Jump -1
      h> ^!Set %startSelection%=^$GetRow$:^$GetCol$
      h> ^!Find "^-+$" RS
      h> ^!Jump Select_END
      h> ^!SelectTo ^%startSelection%
      h> ^!Set %kriq%=^$StrReplace("-";"";^$GetSelection$;0;0)$
      h> :OUTPUT
      h> ^!Jump Select_END
      h> ^!Set %output%=^%output%^%NL%^%NL%=====================^%NL%^%NL%^%kriq%
      h> ^!GoTo LOOP
      h> :END
      h> ;I just delete the old file here; adapt to suit your own needs...
      h> ^!Menu Edit/Clear All
      h> ^%output%


      I still had a problem with this. As I explained before my setup was the
      following:

      The Bat! receives the message and appends it to a file named kriq.txt.
      Then I manually removed what had to be removed. New messages were being
      appended on a (work)daily basis.

      When I apply the above clip to Kriq.txt I am stuck with the result of the
      transformation. That is: only that part of Kriq.txt (at the end of the file)
      that contained the newly appended messages was being treated and "remembered"
      by this clip. All the earlier results simply were not being copied, and thus
      would have been lost forever.

      This seems the easiest way out to me: I have changed the last line of code

      ^%output%

      into

      ^!AppendToFile "D:\Program Files\The Bat\MAIL\Kriqs.txt" ^%output%

      So now I end up with an empty Kriq.txt, ready to receive the next messages,
      and a Kriqs.txt containing (and adding up) all the earlier results.
      It works!

      Thanks again for your help.

      --
      Best Whishes,
      Mark
      using The Bat! 1.63 Beta/7
    • hugo_paulissen
      Hi Mark, ... the ... [snip] ... of code ... Great you found out how to place something at the end of the current file (the clip showed that you had to do
      Message 2 of 13 , May 2, 2003
      • 0 Attachment
        Hi Mark,

        > I still had a problem with this. As I explained before my setup was
        the
        > following:
        >
        [snip]
        > This seems the easiest way out to me: I have changed the last line
        of code
        >
        > ^%output%
        >
        > into
        >
        > ^!AppendToFile "D:\Program Files\The Bat\MAIL\Kriqs.txt" ^%output%
        >

        Great you found out how to place something at the end of the current
        file (the clip showed that you had to do something with the last
        line ;-).

        Hugo
      Your message has been successfully submitted and would be delivered to recipients shortly.