Results 1 to 2 of 2
  1. #1
    Join Date
    Mar 2004
    Posts
    139

    Unanswered: Sorting text output

    I've created this text file using the writeline and transfertext vb methods.

    03 B00000656 3.09 -72
    01 45675 JAMES GANG SCREENPRINTING 508720
    02 6 1 3278 MISPULL 0 -19 0 0
    The file is created in two steps, A. 01 & 02 B. 03. I wasn't able to create the file in the proper sequence b/c of the way the commands worked.

    I need it to look like this:

    01 45675 JAMES GANG SCREENPRINTING 508720
    02 6 1 3278 MISPULL 0 -19 0 0
    03 B00000656 3.09 -72

    I can use the DOS sort command to put in the right order but as far as I can tell it only works file by file.

    I would like to sort the entire file contents of a directory automatically and also switch the extension from .txt to .cr1.

    Any ideas are greately appreciated.
    Thanks,
    Bill

  2. #2
    Join Date
    May 2004
    Location
    NH
    Posts
    87
    I think the first step might be to sort out why you're having problems sorting into a text field correctly...

    If there's no resoultion to that, then:
    1.) Do you know how many text files there are within that directory, or is it dynamic? If it's static then you could write a batch file to accomplish what you'd like.
    2.) If it's dynamic, then I'm not sure of the best way to accomplish this. However I do have some ideas:
    - The following link may be helpful: Working with Files, Folder, .... Using these functions you can get a list of all the files and rename them, however there are a couple of ways you can sort at this point.
    - Write a Java program to accomplish this.

    Let me know if you need more detail...

    -Warren

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •