reorder text wave by alphabetic order

Hello,
It may be a basic question but I didn't know who to reorder my text wave by alphabetic order.

I have a wave like:
Make/T/ w
w[0] = DA10_elecCal_2
w[1] = DA10_elecCal_3
w[2] = DA11_elecCal_2
w[3] = DA11_elecCal_3
w[4] = DA10_CurrentCal_2
w[5] = DA10_CurrentCal_3
w[6] = DA11_CurrentCal_2
w[7] = DA11_CurrentCal_3

and I want
w[0] = DA10_CurrentCal_2
w[1] = DA10_CurrentCal_3
w[2] = DA10_elecCal_2
w[3] = DA10_elecCal_3
w[4] = DA11_CurrentCal_2
w[5] = DA11_CurrentCal_3
w[6] = DA11_elecCal_2
w[7] = DA11_elecCal_3

Thanks

Does this do the job?
Function test()
    Make/T/N=8 w
    w[0] = "DA10_elecCal_2"
    w[1] ="DA10_elecCal_3"
    w[2] = "DA11_elecCal_2"
    w[3] = "DA11_elecCal_3"
    w[4] = "DA10_CurrentCal_2"
    w[5] = "DA10_CurrentCal_3"
    w[6] = "DA11_CurrentCal_2"
    w[7] = "DA11_CurrentCal_3"
    sort w w
End

HTH,
Kurt
Euhhh in fact, I realized that my name are a bit more tricky, I have the channel within them that doesn't have to be taken into account but I have a group number that is important, it means that I have:

w[0] = DA10_elecCal_ch2_1001
w[1] = DA10_elecCal_ch3_1001
w[2] = DA10_elecCal_ch2_1002
w[3] = DA10_elecCal_ch3_1002
w[4] = DA10_elecCal_ch2_1003
w[5] = DA10_elecCal_ch3_1003
w[6] = DA11_elecCal_ch2_1001
w[7] = DA11_elecCal_ch3_1001
w[8] = DA10_CurrentCal_ch2_1001
w[9] = DA10_CurrentCal_ch3_1001
w[10] = DA11_CurrentCal_ch2_1001
w[11] = DA11_CurrentCal_ch3_1001

and I need
w[0] = DA10_CurrentCal_ch2_1001
w[1] = DA10_CurrentCal_ch3_1001
w[2] = DA10_elecCal_ch2_1001
w[3] = DA10_elecCal_ch3_1001
w[4] = DA10_elecCal_ch2_1002
w[5] = DA10_elecCal_ch3_1002
w[6] = DA10_elecCal_ch2_1003
w[7] = DA10_elecCal_ch3_1003
w[8] = DA11_CurrentCal_ch2_1001
w[9] = DA11_CurrentCal_ch3_1001
w[10] = DA11_elecCal_ch2_1001
w[11] = DA11_elecCal_ch3_1001

I was wondering if I can sort it only according to the first part of the name?
if you have any idea, thank you very much
How about this?
Function Test()
    Make/O/N=12/T w
    w[0] = "DA10_elecCal_ch2_1001"
    w[1] = "DA10_elecCal_ch3_1001"
    w[2] = "DA10_elecCal_ch2_1002"
    w[3] = "DA10_elecCal_ch3_1002"
    w[4] = "DA10_elecCal_ch2_1003"
    w[5] = "DA10_elecCal_ch3_1003"
    w[6] = "DA11_elecCal_ch2_1001"
    w[7] = "DA11_elecCal_ch3_1001"
    w[8] = "DA10_CurrentCal_ch2_1001"
    w[9] = "DA10_CurrentCal_ch3_1001"
    w[10] = "DA11_CurrentCal_ch2_1001"
    w[11] = "DA11_CurrentCal_ch3_1001"

    Make/O/N=(12)/T w0, w1, w2, w3
    variable i
    string s0, s1, s2, s3
    for(i=0; i<12; i+=1)
        sscanf w[i], "%[^_]_%[^_]_%[^_]_%[^_]", s0, s1, s2, s3
        w0[i] = s0
        w1[i] = s1
        w2[i] = s2
        w3[i] = s3
    endfor
    Sort {w0, w3, w1, w2}, w
End
You might also benefit from the /A flag for the Sort operation. It will correctly order the numeric part of a name, so that DA0 would be before DA10.

John Weeks
WaveMetrics, Inc.
support@wavemetrics.com