package file;

import java.io.BufferedReader;

import java.io.File;

import java.io.FileInputStream;

import java.io.InputStreamReader;

import java.util.Date;

public class ImportFile {

    public static void main(String[] args) {

       System.out.println(new Date());

       String path = "E:\\数据.txt";  //文件路径

       File file = new File(path);

       if(file.exists() && file.isFile()){

          try{

             InputStreamReader read = new InputStreamReader(new FileInputStream(file),"GBK");  //设置文字编码

            BufferedReader bufferRead = new BufferedReader(read);

            String lineText = null;

         while(bufferRead.readLine() != null){

              lineText = bufferRead.readLine();

              String data[] = lineText.split("\t"); //本文件中按制表符分割

              for(String x : data){

               System.out.println(x);

              }

            }

            read.close();

}catch(Exception e){

         e.printStackTrace();

      }

}

System.out.println(new Date());

}

}

最新文章

  1. Linux文件系统层次结构标准
  2. 2、C#面向对象:封装、继承、多态、String、集合、文件(上)
  3. 立即执行函数与window.onload作用类似
  4. Java异常-一般异常和运行时异常的区别
  5. php设计模式之单例、多例设计模式
  6. .Net4.0 ashx页面报错:检测到有潜在危险的Request.Form值(转)
  7. 嵌入式C开发人员的最好的0x10道笔试题
  8. UVA 10317 - Equating Equations (背包)
  9. PAT (Advanced Level) 1105. Spiral Matrix (25)
  10. 【Java SE】如何安装JDK以及配置Java运行环境
  11. MFC,ADO方式实现数据库操作
  12. [开发技巧]·TensorFlow中numpy与tensor数据相互转化
  13. ARM指令集详解
  14. springmvd接收参数问题
  15. mfs 使用心得
  16. mac 安装geckodriver和chromedriver
  17. 使用Tomcat部署应用
  18. C/C++ 二维数组
  19. 你对position的了解有多少?
  20. cmd获取批处理文件所在路径

热门文章

  1. 北京联通IPTV 数码视讯 Q1 破解过程
  2. ab输出信息解释以及Failed requests原因分析
  3. bzoj 1798 线段树
  4. kubernetes挂载ceph rbd和cephfs的方法
  5. Go_13:Go常用功能总结一阶段
  6. P2831 愤怒的小鸟
  7. sys模块python
  8. python反射,单例模式
  9. 路径名导致的异常:javax.imageio.IIOException: Can't read input file!
  10. bzoj千题计划162:bzoj2006: [NOI2010]超级钢琴