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

Re: [Clip] Need to reorder some fields

Expand Messages
  • James Senick
    ... I use Jody s ReOrder Fields clip from the NoteBlock collection: ... The GetField is part of it, you re just
    Message 1 of 14 , Feb 2, 2008
    • 0 Attachment
      B.P. de Vries wrote:
      > Hello,
      > I have a ;-delimited file in which field 3 and 4 should be 4 and 3. So I
      > have to have the contents of field 4 in field 3 and the contents of
      > field 3 in field 4.
      > Is there a quick way to do this?
      >
      I use Jody's ReOrder Fields clip from the NoteBlock collection:
      <http://www.notetab.net/html/library.htm>
      > I tried it with Getfield but how do I replace those field the way I want?
      > Thanks in advance
      >
      The GetField is part of it, you're just missing the next step. So, if
      you only had 4 fields of which the first two remained the same while
      fields 3 and 4 were swapped, would could do something like this:

      ^!Set %Get1%=^$GetField(^%row%;1)$
      ^!Set %Get2%=^$GetField(^%row%;2)$
      ^!Set %Get3%=^$GetField(^%row%;4)$
      ^!Set %Get4%=^$GetField(^%row%;3)$

      What remains from there forward is outputting the delimited results and
      any new sorting you require. If you get Jody's NoteBlock collection,
      use NoteTab's "open as a Document" feature to see how it is all done.
    • B.P. de Vries
      Axel (and the others), thanks But when I use this : ^!Replace ^(.*?);(.*?);(.*?);(.*?)$ $1;$2;$4;$3 ATIWRS in a clip I get the fourth field as the
      Message 2 of 14 , Feb 2, 2008
      • 0 Attachment
        Axel (and the others), thanks

        But when I use this : ^!Replace "^(.*?);(.*?);(.*?);(.*?)$" >>
        "$1;$2;$4;$3" ATIWRS
        in a clip I get the fourth field as the third, but I'm missing the new
        fourth field (the old third field).

        Something is missing but what?

        Met vriendelijke groet,

        *Bauke P. de Vries
        *



        Axel Berger schreef:
        > "B.P. de Vries" wrote:
        >
        >> So I have to have the contents of field 4 in field 3 and
        >> the contents of field 3 in field 4.
        >> Is there a quick way to do this?
        >>
        >
        > Do you need a generic way to this often or do you only want it done
        > once?
        >
        > If the latter the easiest way is use any program that can read and write
        > .CSV and do it there. The one you have probably got is M$-Excel.
        >
        > A bit more effort is a Regex replace (done here for 2 and 3):
        > ^(.*?);(.*?);(.*?);(.*?)$
        > $1;$3;$2;$4
        >
        > Axel
        >
        >
        > Fookes Software: http://www.fookes.com/
        > Fookes Software Discussion Lists: http://www.fookes.com/groups.php
        > Yahoo! Groups Links
        >
        >
        >
        >
        >


        [Non-text portions of this message have been removed]
      • Axel Berger
        ... Is the old fourth the last field in the line? If not the last brackets, i.e. $4 will catch all the rest of the line with the old $3 placed after all that.
        Message 3 of 14 , Feb 2, 2008
        • 0 Attachment
          "B.P. de Vries" wrote:
          > Something is missing but what?

          Is the old fourth the last field in the line? If not the last brackets,
          i.e. $4 will catch all the rest of the line with the old $3 placed after
          all that. It is safest to use one pair of brackets for every field, I
          only used four as an example.

          N.B: As far as I know neither T nor I do anything sensible in a Regex,
          AWRS should suffice.

          Axel
        • notetab_is_great
          ... Probably (.*?); should actually be ([^;]*); for the first three () groups. The last would be fine with (.*?)
          Message 4 of 14 , Feb 2, 2008
          • 0 Attachment
            --- In ntb-clips@yahoogroups.com, "B.P. de Vries" <bauke@...> wrote:
            >
            > Axel (and the others), thanks
            >
            > But when I use this : ^!Replace "^(.*?);(.*?);(.*?);(.*?)$" >>
            > "$1;$2;$4;$3" ATIWRS
            > in a clip I get the fourth field as the third, but I'm missing the new
            > fourth field (the old third field).
            >
            > Something is missing but what?

            Probably (.*?); should actually be ([^;]*); for the first three ()
            groups. The last would be fine with (.*?)
          • B.P. de Vries
            Hello, I tried the brackets and did something wrong. Have to read more about Regex. For the moment I put in an extra (.*?) and of course an extra $5 and this
            Message 5 of 14 , Feb 2, 2008
            • 0 Attachment
              Hello,

              I tried the brackets and did something wrong. Have to read more about Regex.
              For the moment I put in an extra (.*?) and of course an extra $5 and
              this works good enough for the moment.

              Thanks a lot all of you and have a nice weekend.

              Met vriendelijke groet,

              *Bauke P. de Vries
              *



              Axel Berger schreef:
              > "B.P. de Vries" wrote:
              >
              >> Something is missing but what?
              >>
              >
              > Is the old fourth the last field in the line? If not the last brackets,
              > i.e. $4 will catch all the rest of the line with the old $3 placed after
              > all that. It is safest to use one pair of brackets for every field, I
              > only used four as an example.
              >
              > N.B: As far as I know neither T nor I do anything sensible in a Regex,
              > AWRS should suffice.
              >
              > Axel
              >
              >
              > Fookes Software: http://www.fookes.com/
              > Fookes Software Discussion Lists: http://www.fookes.com/groups.php
              > Yahoo! Groups Links
              >
              >
              >
              >
              >


              [Non-text portions of this message have been removed]
            • dracorat
              Here is the proper command: ^!Replace ^([^;]*);([^;]*);([^;]*);([^; r]*)(.*)?$ $1;$2;$4;$3$5 AWRS --Keith ... write
              Message 6 of 14 , Feb 5, 2008
              • 0 Attachment
                Here is the proper command:
                ^!Replace "^([^;]*);([^;]*);([^;]*);([^;\r]*)(.*)?$" >>
                "$1;$2;$4;$3$5" AWRS

                --Keith

                --- In ntb-clips@yahoogroups.com, "B.P. de Vries" <bauke@...> wrote:
                >
                > Axel (and the others), thanks
                >
                > But when I use this : ^!Replace "^(.*?);(.*?);(.*?);(.*?)$" >>
                > "$1;$2;$4;$3" ATIWRS
                > in a clip I get the fourth field as the third, but I'm missing the new
                > fourth field (the old third field).
                >
                > Something is missing but what?
                >
                > Met vriendelijke groet,
                >
                > *Bauke P. de Vries
                > *
                >
                >
                >
                > Axel Berger schreef:
                > > "B.P. de Vries" wrote:
                > >
                > >> So I have to have the contents of field 4 in field 3 and
                > >> the contents of field 3 in field 4.
                > >> Is there a quick way to do this?
                > >>
                > >
                > > Do you need a generic way to this often or do you only want it done
                > > once?
                > >
                > > If the latter the easiest way is use any program that can read and
                write
                > > .CSV and do it there. The one you have probably got is M$-Excel.
                > >
                > > A bit more effort is a Regex replace (done here for 2 and 3):
                > > ^(.*?);(.*?);(.*?);(.*?)$
                > > $1;$3;$2;$4
                > >
                > > Axel
                > >
                > >
                > > Fookes Software: http://www.fookes.com/
                > > Fookes Software Discussion Lists: http://www.fookes.com/groups.php
                > > Yahoo! Groups Links
                > >
                > >
                > >
                > >
                > >
                >
                >
                > [Non-text portions of this message have been removed]
                >
              • Axel Berger
                ... I see what you re doing, but I doubt the necessity. As far as I know the not greedy modifier will suffice to make the brackets grab only one data field.
                Message 7 of 14 , Feb 5, 2008
                • 0 Attachment
                  dracorat wrote:
                  > Here is the proper command:
                  > ^!Replace "^([^;]*);([^;]*);([^;]*);([^;\r]*)(.*)?$" >>
                  > "$1;$2;$4;$3$5" AWRS

                  I see what you're doing, but I doubt the necessity. As far as I know the
                  "not greedy" modifier will suffice to make the brackets grab only one
                  data field.

                  N.B: I'm a bit surprised my guess for the semicolon as separator worked.
                  Do the Dutch use the comma as decimal delimiter same as the Germans?

                  Axel
                • B.P. de Vries
                  Thanks again! I don t know about the other Dutch, but I m using the semicolon for years now. Met vriendelijke groet, *Bauke P. de Vries * ... [Non-text
                  Message 8 of 14 , Feb 6, 2008
                  • 0 Attachment
                    Thanks again! I don't know about the other Dutch, but I'm using the
                    semicolon for years now.

                    Met vriendelijke groet,

                    *Bauke P. de Vries
                    *



                    Axel Berger schreef:
                    > dracorat wrote:
                    >
                    >> Here is the proper command:
                    >> ^!Replace "^([^;]*);([^;]*);([^;]*);([^;\r]*)(.*)?$" >>
                    >> "$1;$2;$4;$3$5" AWRS
                    >>
                    >
                    > I see what you're doing, but I doubt the necessity. As far as I know the
                    > "not greedy" modifier will suffice to make the brackets grab only one
                    > data field.
                    >
                    > N.B: I'm a bit surprised my guess for the semicolon as separator worked.
                    > Do the Dutch use the comma as decimal delimiter same as the Germans?
                    >
                    > Axel
                    >
                    >
                    > Fookes Software: http://www.fookes.com/
                    > Fookes Software Discussion Lists: http://www.fookes.com/groups.php
                    > Yahoo! Groups Links
                    >
                    >
                    >
                    >
                    >


                    [Non-text portions of this message have been removed]
                  • Hugo Paulissen
                    Hi Bauke, So you buy a bottle of milk for Euro 0;89? The decimal delimite is a comma indeed. ;-) Hugo ... From: B.P. de Vries To:
                    Message 9 of 14 , Feb 6, 2008
                    • 0 Attachment
                      Hi Bauke,

                      So you buy a bottle of milk for Euro 0;89? The decimal delimite is a comma indeed.

                      ;-) Hugo


                      ----- Original Message ----
                      From: B.P. de Vries <bauke@...>
                      To: ntb-clips@yahoogroups.com
                      Sent: Wednesday, February 6, 2008 10:10:07 AM
                      Subject: Re: [Clip] Re: Need to reorder some fields

                      Thanks again! I don't know about the other Dutch, but I'm using the
                      semicolon for years now.

                      Met vriendelijke groet,

                      *Bauke P. de Vries
                      *

                      Axel Berger schreef:
                      > dracorat wrote:
                      >
                      >> Here is the proper command:
                      >> ^!Replace "^([^;]*);([ ^;]*);([^ ;]*);([^; \r]*)(.*) ?$" >>
                      >> "$1;$2;$4;$3$ 5" AWRS
                      >>
                      >
                      > I see what you're doing, but I doubt the necessity. As far as I know the
                      > "not greedy" modifier will suffice to make the brackets grab only one
                      > data field.
                      >
                      > N.B: I'm a bit surprised my guess for the semicolon as separator worked.
                      > Do the Dutch use the comma as decimal delimiter same as the Germans?
                      >
                      > Axel
                      >
                      >
                      > Fookes Software: http://www.fookes com/
                      > Fookes Software Discussion Lists: http://www.fookes com/groups. php
                      > Yahoo! Groups Links
                      >
                      >
                      >
                      >
                      >

                      [Non-text portions of this message have been removed]





                      ____________________________________________________________________________________
                      Looking for last minute shopping deals?
                      Find them fast with Yahoo! Search. http://tools.search.yahoo.com/newsearch/category.php?category=shopping

                      [Non-text portions of this message have been removed]
                    • Axel Berger
                      ... You misunderstood. Usually the comma is the field delimiter and only in those places, where it is used as decimal delimiter, fields are separated by the
                      Message 10 of 14 , Feb 6, 2008
                      • 0 Attachment
                        Hugo Paulissen wrote:
                        > The decimal delimite is a comma indeed.

                        You misunderstood. Usually the comma is the field delimiter and only in
                        those places, where it is used as decimal delimiter, fields are
                        separated by the semicolon instead. This is done in Germany (not by me,
                        all my computers are set up for international English) but I did not
                        know about the Netherlands.

                        Axel
                      • B.P. de Vries
                        Hello Hugo, Not normally, but most Dutch would understand what you ment. ;-) Met vriendelijke groet, *Bauke P. de Vries * ... [Non-text portions of this
                        Message 11 of 14 , Feb 6, 2008
                        • 0 Attachment
                          Hello Hugo,

                          Not normally, but most Dutch would understand what you ment. ;-)

                          Met vriendelijke groet,

                          *Bauke P. de Vries
                          *



                          Hugo Paulissen schreef:
                          > Hi Bauke,
                          >
                          > So you buy a bottle of milk for Euro 0;89? The decimal delimite is a comma indeed.
                          >
                          > ;-) Hugo
                          >
                          >
                          > ----- Original Message ----
                          > From: B.P. de Vries <bauke@...>
                          > To: ntb-clips@yahoogroups.com
                          > Sent: Wednesday, February 6, 2008 10:10:07 AM
                          > Subject: Re: [Clip] Re: Need to reorder some fields
                          >
                          > Thanks again! I don't know about the other Dutch, but I'm using the
                          > semicolon for years now.
                          >
                          > Met vriendelijke groet,
                          >
                          > *Bauke P. de Vries
                          > *
                          >
                          > Axel Berger schreef:
                          >
                          >> dracorat wrote:
                          >>
                          >>
                          >>> Here is the proper command:
                          >>> ^!Replace "^([^;]*);([ ^;]*);([^ ;]*);([^; \r]*)(.*) ?$" >>
                          >>> "$1;$2;$4;$3$ 5" AWRS
                          >>>
                          >>>
                          >> I see what you're doing, but I doubt the necessity. As far as I know the
                          >> "not greedy" modifier will suffice to make the brackets grab only one
                          >> data field.
                          >>
                          >> N.B: I'm a bit surprised my guess for the semicolon as separator worked.
                          >> Do the Dutch use the comma as decimal delimiter same as the Germans?
                          >>
                          >> Axel
                          >>
                          >>
                          >> Fookes Software: http://www.fookes com/
                          >> Fookes Software Discussion Lists: http://www.fookes com/groups. php
                          >> Yahoo! Groups Links
                          >>
                          >>
                          >>
                          >>
                          >>
                          >>
                          >
                          > [Non-text portions of this message have been removed]
                          >
                          >
                          >
                          >
                          >
                          > ____________________________________________________________________________________
                          > Looking for last minute shopping deals?
                          > Find them fast with Yahoo! Search. http://tools.search.yahoo.com/newsearch/category.php?category=shopping
                          >
                          > [Non-text portions of this message have been removed]
                          >
                          >
                          >
                          > Fookes Software: http://www.fookes.com/
                          > Fookes Software Discussion Lists: http://www.fookes.com/groups.php
                          > Yahoo! Groups Links
                          >
                          >
                          >
                          >
                          >


                          [Non-text portions of this message have been removed]
                        Your message has been successfully submitted and would be delivered to recipients shortly.