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

[NH] Re: replace

Expand Messages
  • Jody
    Hi aRPi, ... I have one that will work in my NoteBlock, but it has a small bug in it that I haven t figured out what to do with it yet. Here is one that works
    Message 1 of 4 , Feb 27, 2000
    • 0 Attachment
      Hi aRPi,

      > sentece1 = sentence2
      > I need to replace sentence1 with sentence2 (to get sentence2 =
      > sentence1).

      I have one that will work in my NoteBlock, but it has a small bug
      in it that I haven't figured out what to do with it yet. Here is
      one that works with two fields. It is already set to go provided
      you only have one equal sign with a space on each side of it.
      This Clip will not work if you have more than the two fields in
      which case you need to use my NoteBlock "ReOrder Fields." The
      bug in it is for every field you have less than 9 which is the
      total it will do the delimiter you use will be pasted at the end
      of each line. A simple selection of them and replace all fixes
      it right up though.

      The clip takes this:

      Mary had a little lamb. = It's fleece was white as snow.
      Mary had a little lamb. = It's fleece was white as snow.
      Mary had a little lamb. = It's fleece was white as snow.

      and outputs this:

      It's fleece was white as snow. = Mary had a little lamb.
      It's fleece was white as snow. = Mary had a little lamb.
      It's fleece was white as snow. = Mary had a little lamb.

      Watch out that the long lines below do not get hard line breaks
      in them. If you see extra text getting pasted into your doc look
      for it in the script and join the line up to the previous line.

      <--- Copy below this line --->
      H=ReOrder Fields 2
      ; Last Updated 02/27/2000, Sojourner@..., jody

      ;long line till blank - make sure it does not get hard wrapped.
      ^!Continue Re0rders lines of delimited text having two fields into an order you choose. Results are pasted in new document. Place your cursor at the beginning of the line you want to start on. Continue?

      ^!SetHintInfo ReOrdering...
      ^!SetScreenUpdate Off
      ^!ClearVariable %NewOrder%

      ; Sets delimiter used in your fields such as , ; : | ";"
      ;;long line till blank - make sure it does not get hard wrapped.
      ^!Set %Delimiter%=^?[Enter Delimiter: ^p ^t ";", Tab shown=^p^=^%nl%|^t^=^%tab%|";"|_ = ]
      ^!SetDelimiter ^%Delimiter%
      ^!Set %rn%=1

      ^!IfTrue ^$IsEmpty(^$GetField(^$GetRow$;1)$)$ Oops

      :Loop
      ;long line till blank - make sure it does not get hard wrapped.
      ^!Set %GetFirst%=^$GetField(^%rn%;^?[Put what existing field in &1st field=2])$^%Delimiter%^$GetField(^%rn%;^?[Put what existing field in &2nd field=1])$

      ^!Append %NewOrder%=^%GetFirst%^%nl%
      ^!Inc %rn%
      ^!If ^$GetRow$ = ^$Calc(^$GetLineCount$-1;0)$ PasteNew
      ^!Goto Loop

      :PasteNew
      ^!SetClipboard ^%NewOrder%
      ^!Toolbar Paste New
      ^!Jump 1
      ^!Goto End

      :Oops
      ^!Info [L]Oops! You either started on a blank line, told it to start on a blank line, or you use a delimiter that is not in the first field of the line you started on. Sorry, try again.

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

      Happy HTML'n!
      Jody

      http://www.sureword.com/notetab

      The NoteTab and Html List...
      mailto:Ntb-html-Subscribe@...
      mailto:Ntb-html-UnSubscribe@...
    • aRPi
      Hi all! I have a line like this: sentece1 = sentence2 (the = is never used in sentence1 or sentence2) I need to replace sentence1 with sentence2 (to get
      Message 2 of 4 , Feb 27, 2000
      • 0 Attachment
        Hi all!

        I have a line like this:
        sentece1 = sentence2
        (the = is never used in sentence1 or sentence2)
        I need to replace sentence1 with sentence2 (to get sentence2 = sentence1). I
        have a huge text file with
        these lines so please help me.
        TIA

        aRPi
      • Jody
        Hi aRPi, ... Glad it did the job for you. When and if you reply to posts please delete the test that is not needed to understand your reply. Thanks. Happy
        Message 3 of 4 , Feb 28, 2000
        • 0 Attachment
          Hi aRPi,

          > thank you for the code, it works fine.

          Glad it did the job for you. When and if you reply to posts
          please delete the test that is not needed to understand your
          reply. Thanks.

          Happy HTML'n!
          Jody

          http://www.sureword.com/notetab

          The NoteTab and Html List...
          mailto:Ntb-html-Subscribe@...
          mailto:Ntb-html-UnSubscribe@...
        • aRPi
          Jody, thank you for the code, it works fine. aRPi ... From: Jody To: Sent: Sunday, February 27, 2000 12:31 PM Subject:
          Message 4 of 4 , Jan 22, 1958
          • 0 Attachment
            Jody,

            thank you for the code, it works fine.


            aRPi

            ----- Original Message -----
            From: Jody <KJB1611@...>
            To: <ntb-html@egroups.com>
            Sent: Sunday, February 27, 2000 12:31 PM
            Subject: [NH] Re: replace


            > Hi aRPi,
            >
            > > sentece1 = sentence2
            > > I need to replace sentence1 with sentence2 (to get sentence2 =
            > > sentence1).
            >
            > I have one that will work in my NoteBlock, but it has a small bug
            > in it that I haven't figured out what to do with it yet. Here is
            > one that works with two fields. It is already set to go provided
            > you only have one equal sign with a space on each side of it.
            > This Clip will not work if you have more than the two fields in
            > which case you need to use my NoteBlock "ReOrder Fields." The
            > bug in it is for every field you have less than 9 which is the
            > total it will do the delimiter you use will be pasted at the end
            > of each line. A simple selection of them and replace all fixes
            > it right up though.
            >
            > The clip takes this:
            >
            > Mary had a little lamb. = It's fleece was white as snow.
            > Mary had a little lamb. = It's fleece was white as snow.
            > Mary had a little lamb. = It's fleece was white as snow.
            >
            > and outputs this:
            >
            > It's fleece was white as snow. = Mary had a little lamb.
            > It's fleece was white as snow. = Mary had a little lamb.
            > It's fleece was white as snow. = Mary had a little lamb.
            >
            > Watch out that the long lines below do not get hard line breaks
            > in them. If you see extra text getting pasted into your doc look
            > for it in the script and join the line up to the previous line.
            >
            > <--- Copy below this line --->
            > H=ReOrder Fields 2
            > ; Last Updated 02/27/2000, Sojourner@..., jody
            >
            > ;long line till blank - make sure it does not get hard wrapped.
            > ^!Continue Re0rders lines of delimited text having two fields into an
            order you choose. Results are pasted in new document. Place your cursor at
            the beginning of the line you want to start on. Continue?
            >
            > ^!SetHintInfo ReOrdering...
            > ^!SetScreenUpdate Off
            > ^!ClearVariable %NewOrder%
            >
            > ; Sets delimiter used in your fields such as , ; : | ";"
            > ;;long line till blank - make sure it does not get hard wrapped.
            > ^!Set %Delimiter%=^?[Enter Delimiter: ^p ^t ";", Tab
            shown=^p^=^%nl%|^t^=^%tab%|";"|_ = ]
            > ^!SetDelimiter ^%Delimiter%
            > ^!Set %rn%=1
            >
            > ^!IfTrue ^$IsEmpty(^$GetField(^$GetRow$;1)$)$ Oops
            >
            > :Loop
            > ;long line till blank - make sure it does not get hard wrapped.
            > ^!Set %GetFirst%=^$GetField(^%rn%;^?[Put what existing field in &1st
            field=2])$^%Delimiter%^$GetField(^%rn%;^?[Put what existing field in &2nd
            field=1])$
            >
            > ^!Append %NewOrder%=^%GetFirst%^%nl%
            > ^!Inc %rn%
            > ^!If ^$GetRow$ = ^$Calc(^$GetLineCount$-1;0)$ PasteNew
            > ^!Goto Loop
            >
            > :PasteNew
            > ^!SetClipboard ^%NewOrder%
            > ^!Toolbar Paste New
            > ^!Jump 1
            > ^!Goto End
            >
            > :Oops
            > ^!Info [L]Oops! You either started on a blank line, told it to start on a
            blank line, or you use a delimiter that is not in the first field of the
            line you started on. Sorry, try again.
            >
            > <--- Copy above this line, right --->
            > <--- click over a Library, and --->
            > <--- choose "Add from Clipboard" --->
            >
            > Happy HTML'n!
            > Jody
            >
            > http://www.sureword.com/notetab
            >
            > The NoteTab and Html List...
            > mailto:Ntb-html-Subscribe@...
            > mailto:Ntb-html-UnSubscribe@...
            >
            >
            >
            >
            >
            > ------------------------------------------------------------------------
            > GET A NEXTCARD VISA, in 30 seconds! Get rates as low as 2.9%
            > Intro or 9.9% Fixed APR and no hidden fees. Apply NOW!
            > http://click.egroups.com/1/951/4/_/2799/_/951647505/
            >
            > -- Create a poll/survey for your group!
            > -- http://www.egroups.com/vote?listname=ntb-html&m=1
            >
            >
            >
          Your message has been successfully submitted and would be delivered to recipients shortly.