修改csv格式
parent
2cb96e3f5a
commit
6896f83855
@ -0,0 +1,43 @@
|
|||||||
|
package me.zhengjie;
|
||||||
|
|
||||||
|
import cn.hutool.poi.excel.ExcelReader;
|
||||||
|
import cn.hutool.poi.excel.ExcelUtil;
|
||||||
|
import com.google.common.collect.Lists;
|
||||||
|
import com.google.common.collect.Sets;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import me.zhengjie.modules.uploadnew.util.TxtUtils;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.HashSet;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Enzo
|
||||||
|
* @date : 2022/4/11
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
public class TxtDemo {
|
||||||
|
public static void main(String[] args) {
|
||||||
|
String s = "C:\\Users\\a\\Desktop\\正装.txt";
|
||||||
|
|
||||||
|
try {
|
||||||
|
List<String> strings = TxtUtils.txtParseListVyUrl(s);
|
||||||
|
HashSet<String> strings1 = Sets.newHashSet(strings);
|
||||||
|
|
||||||
|
List<String> list = Lists.newArrayList();
|
||||||
|
strings1.forEach(phone ->{
|
||||||
|
System.out.println("the phone length as {}"+phone.length());
|
||||||
|
|
||||||
|
if (phone.length() == 11) {
|
||||||
|
list.add(phone);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
System.out.println(list.size());
|
||||||
|
} catch (IOException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue