字符串按照长度排序
2013-01-28 00:00
429 查看
VBA:
好像不能识别一些在excel里有特殊意义的字符。
[/code]
好像不能识别一些在excel里有特殊意义的字符。
Sub Button1_Click() Dim max As Integer max = 1 Dim lengths(200) As Integer Dim tmp As String For i = 1 To 200 max = i tmp = Cells(i, 1) If tmp = "" Then Exit For End If For j = i + 1 To 200 If Cells(j, 1) = "" Then Exit For End If If Len(Cells(max, 1)) < Len(Cells(j, 1)) Then max = j End If Next If i <> max Then Cells(i, 1) = Cells(max, 1) Cells(max, 1) = tmp End If Cells(i, 2) = Len(Cells(max, 1)) Next End Sub
//最简单的是通过shell
awk '{ print length(), $0 | "sort -n" }' fileName
//通过sql, 将数据倒入Tmp表格
select len(fileName), fileName from Test1 order by len(fileName)
[/code]
相关文章推荐
- Collections练习之按照字符串长度进行排序
- 按照字符串的长度排序
- 用Set集合,按照字符串的长度排序的方法
- 按照字符串长度排序
- 【php】将php中的数组元祖按照字符串长度进行排序
- TreeSet按照字符串的长度排序(用比较器)
- HashSet排序【自定义一种排序方式:例如按照字符串的长短比较大小。如长度相同,就以数字比较】
- php 对数组按照字符串长度排序
- TreeSet按照字符串长度进行排序
- 《黑马程序员》 TreeSet集合练习之 按照字符串长度排序
- TreeSet重写比较器按照字符串长度排序
- Java TreeSet集合排序 && 定义一个类实现Comparator接口,覆盖compare方法 && 按照字符串长度排序
- 对给定字符串,取出它的子字符串,并把子字符串按照长度排序
- 【Java学习】Java按照字符串长度排序
- TreeSet基本应用:按照字符串长度排序
- perl按照字符串长度进行排序,sort函数的示例
- 按照字符串长度排序
- 已知字母序列【d, g, e, c, f, b, o, a】,请实现一个函数针对输入的一组字符串 input[] = {"bed", "dog", "dear", "eye"},按照字母顺序排序并打印
- 输入3个字符串,将它们按照字母由大到小排序
- MySQL取出数字字符串的一部分,然后按照数值大小排序