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

Re: [Clip] Create File From A File

Expand Messages
  • bozlawless
    no not always a % at the start but always a O#### that is the leter O followed by four numbers the filename is always before M30 second line from last line
    Message 1 of 21 , Dec 6, 2009
    • 0 Attachment
      no not always a % at the start but always a O#### that is the leter O followed by four numbers

      the "filename" is always before M30 second line from last line




      --- In ntb-clips@yahoogroups.com, "Don - HtmlFixIt.com" <don@...> wrote:
      >
      > Of course .... if we understand what we are doing and the data pattern.
      >
      > Is there always a return followed by a % to start each file?
      > Is the "filename" always the second from last line, followed by a bunch
      > of blank lines?
      >
      > Is there always an M30 on the last line of each file?
      >
    • bozlawless
      i ran it not sure were it saved them to when it was running it gave me a I/O ERROR
      Message 2 of 21 , Dec 6, 2009
      • 0 Attachment
        i ran it not sure were it saved them to when it was running it gave me a I/O ERROR



        --- In ntb-clips@yahoogroups.com, "flo.gehrke" <flo.gehrke@...> wrote:
        >
        > --- In ntb-clips@yahoogroups.com, "bozlawless" <bozlawless@> wrote:
        > >
        > > Hey sorry its hard for me to convey thru cyberspace what i want sometimes also in life but here goes
        > >
        > > 1. Create a file from O#### to M30
        > >
        > > 2. The file name needs to be same as line just before M30 (FILENAME)
        > >
        > > 3. I don't have any input other than open the master file
        > >
        > > 4. Yes all files will look like this other than the O#### (INFO ) at the start and the name just before the M30
        > >
        > > I pray that is helpful and makes sense
        > >
        > > Thank you to everyone who is helping me on this
        > > Mike
        >
        > Mike,
        >
        > Open your "Master File" and start the following clip. It will split the text you've sent to the group into three parts. Each part is saved in a separate file. So you will get three files named SF 49A.txt, RPM 31C.txt, and SSR 105A.txt.
        >
        >
        > ;^!SetScreenUpdate Off
        > ^!Jump 1
        > :Loop
        > ^!Find "^O\d{4}\C+?M30$" RS
        > ^!IfError End
        > ^!SetClipboard ^$GetSelection$
        > ^!Jump Select_End
        > ^!Jump -1
        > ^!Find "^\(\x20\K.+(?=\x20\))" RS
        > ^!Set %Name%="^$GetSelection$.txt"
        > ^!TextToFile "^$GetDocumentPath$^%Name%" ^$GetClipboard$
        > ^!Goto Loop
        >
        >
        > I hope this will meet your intentions.
        >
        > Regards,
        > Flo
        >
      • flo.gehrke
        ... I ve tested with NT Pro 6.12. What s your NT version? Flo
        Message 3 of 21 , Dec 6, 2009
        • 0 Attachment
          --- In ntb-clips@yahoogroups.com, "bozlawless" <bozlawless@...> wrote:
          >
          > i ran it not sure were it saved them to when it was running it gave
          > me a I/O ERROR

          I've tested with NT Pro 6.12. What's your NT version?

          Flo
        • bozlawless
          ver 6.12 i sent you more info
          Message 4 of 21 , Dec 6, 2009
          • 0 Attachment
            ver 6.12 i sent you more info

            --- In ntb-clips@yahoogroups.com, "flo.gehrke" <flo.gehrke@...> wrote:
            >
            > --- In ntb-clips@yahoogroups.com, "bozlawless" <bozlawless@> wrote:
            > >
            > > i ran it not sure were it saved them to when it was running it gave
            > > me a I/O ERROR
            >
            > I've tested with NT Pro 6.12. What's your NT version?
            >
            > Flo
            >
          • flo.gehrke
            ... Mike, There s a problem with your data. You wrote... 1. that the line before M30 is containing the string that serves as the file name. 2. that this line
            Message 5 of 21 , Dec 6, 2009
            • 0 Attachment
              --- In ntb-clips@yahoogroups.com, "bozlawless" <bozlawless@...> wrote:
              >
              > ver 6.12 i sent you more info
              >

              Mike,

              There's a problem with your data. You wrote...

              1. that the line before "M30" is containing the string that serves as the file name.

              2. that this line has a format like '( SF 240B )'. But that's not the case in all those lines. Consequently, the clip captures another line that doesn't comply with the rules of correct file names. This ends up in an I/O Error.

              You may run the following clip in order to see what those lines in question actually contain:


              ^!Jump 1

              :Loop
              ^!Find "^M30" RS
              ^!IfError End
              ^!Set %Adr%=^$GetLine(-1)$
              ^!Append %List%=^%Adr%^%NL%
              ^!Goto Loop

              :End
              ^!Toolbar New Document
              ^!InsertText ^%List%
              ^!ClearVariable %List%

              For example: See the following lines...

              N84G28U0
              T0101
              M30

              O0303

              As you can see, the line before 'M30' has a format that doesn't accord with the format you described.

              So it's up to you to clean your data or to give us a precise description of all possible formats of this line containing the file name.

              Regards,
              Flo
            • bozlawless
              Flo thanks for your help i cleaned up my master file and put a name above all the M30 but it is still stopping at O1232 AND O1518 When i cleaned up my
              Message 6 of 21 , Dec 7, 2009
              • 0 Attachment
                Flo thanks for your help i cleaned up my "master file" and put a name above all the M30 but it is still stopping at O1232 AND O1518

                When i cleaned up my "master file" and run your second clip it spits out a text file and shoes all the names are good


                Thanks
                Mike

                --- In ntb-clips@yahoogroups.com, "flo.gehrke" <flo.gehrke@...> wrote:
                >
                > --- In ntb-clips@yahoogroups.com, "bozlawless" <bozlawless@> wrote:
                > >
                > > ver 6.12 i sent you more info
                > >
                >
                > Mike,
                >
                > There's a problem with your data. You wrote...
                >
                > 1. that the line before "M30" is containing the string that serves as the file name.
                >
                > 2. that this line has a format like '( SF 240B )'. But that's not the case in all those lines. Consequently, the clip captures another line that doesn't comply with the rules of correct file names. This ends up in an I/O Error.
                >
                > You may run the following clip in order to see what those lines in question actually contain:
                >
                >
                > ^!Jump 1
                >
                > :Loop
                > ^!Find "^M30" RS
                > ^!IfError End
                > ^!Set %Adr%=^$GetLine(-1)$
                > ^!Append %List%=^%Adr%^%NL%
                > ^!Goto Loop
                >
                > :End
                > ^!Toolbar New Document
                > ^!InsertText ^%List%
                > ^!ClearVariable %List%
                >
                > For example: See the following lines...
                >
                > N84G28U0
                > T0101
                > M30
                >
                > O0303
                >
                > As you can see, the line before 'M30' has a format that doesn't accord with the format you described.
                >
                > So it's up to you to clean your data or to give us a precise description of all possible formats of this line containing the file name.
                >
                > Regards,
                > Flo
                >
              Your message has been successfully submitted and would be delivered to recipients shortly.