grouping order number and make new files

grouping order number and make new files

7
NewbieNewbie
7

    Mar 20, 2005#1

    I have a long list file. and I have to select and copy the text by grouping order number and make 365 files.
    I have so many files deal with like belows
    please help me!
    many thanks.


    order1 aaaa ---> copy from this
    order1 bbbb
    order1 ccccc ----> to and make file1
    order2 dddd-----> copy from this
    order2 eeee---> to and make file2
    order3 fffff-----> copy from this
    order3 gggg
    order3 hhhh
    order3 iiiiiii----> to and make file3
    order4 jjjjj------> copying and make file4
    order5 kkk-----> copy from this
    order5 llllllll----> to and make file5

    .........
    order364
    order365 yyyy----> copy from this
    order365 cccc------> to and make file365

    261
    Basic UserBasic User
    261

      Mar 21, 2005#2

      I played around with something:

      InsertMode
      ColumnModeOff
      HexOff
      UnixReOn
      Top
      SelectWord
      Copy
      Key HOME
      StartSelect
      Bottom
      Find Up "^c"
      Key HOME
      Key DOWN ARROW
      Cut
      NewFile
      Paste
      Top
      SelectWord
      Copy
      Top
      Paste
      "
      "
      Top
      Find "order"
      Replace "File"
      SelectWord
      Cut
      Delete
      SaveAs "^c"
      CloseFile

      Basically, this uses the first word on the line to select and cut all of the lines that start with that word. It then saves the cut text to a file.

      (Note that the "^c" in find and saveas use the contents of the clipboard as the string.)

      You would want to save a copy of the original file since the macro cuts the text as it saves it.

      You may want to tweak the names a little if I made a bad assumption.

      Hope this helps!

      Dave
      ASTTMan
      I'm not a Texan, I just live here.

      7
      NewbieNewbie
      7

        Mar 23, 2005#3

        Thank to your answer !
        I adjust your tip to my works. and it works.
        thank you again.