Consulting

Results 1 to 2 of 2

Thread: Solved: Rearrange the location in txt file by EXcel VBA

  1. #1

    Solved: Rearrange the location in txt file by EXcel VBA

    Hi All,

    I have written a marco to convert the data from excel sheet to txt file. In txt file, we have this set pattern:

    #Comment1
    #Comment2

    # (String 1)
    sc 0502
    sc 070C
    sc 0091

    # (String 2)
    sc 0502
    sc 1A0F
    sc 3380

    sc 8607
    sc 861A

    First sc is the starting command (i.e. sc 0502). The middle of sc is the Block and Offset (i.e.sc 070C) where the last sc is the value (i.e. sc 0091) and final we have a ending command to close the block accordingly. Now, i would like the pattern that all block which contains "1A" (i.e. sc 1Axx) to put in first position. The Result like this:

    #Comment1
    #Comment2

    # (String 2)
    sc 0502
    sc 1A0F
    sc 3380

    # (String 1)
    sc 0502
    sc 070C
    sc 0091

    sc 861A
    sc 8607

    Since my marco is already complicated to generate the output txt file. Therefore, i would like to do this action after output txt file. For details, see the attached zip file. Thanks!

    Thanks,
    Ann

  2. #2
    I have solved it in marco (but notthe method for rearrange the location in txt file). BTW, if someone would like to share the methods on it. Welcome.

    Thanks,
    Ann

Posting Permissions

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