Chinaunix首页 | 论坛 | 博客
  • 博客访问: 220302
  • 博文数量: 23
  • 博客积分: 1400
  • 博客等级: 上尉
  • 技术积分: 311
  • 用 户 组: 普通用户
  • 注册时间: 2008-03-29 20:09
文章分类

全部博文(23)

文章存档

2009年(5)

2008年(18)

我的朋友

分类:

2008-07-10 11:24:18

与Java做接口.
SAP发Utf-8 , 逗号分隔.
Java读取.
 
Java代码:
/*
 * Created on 2008-7-10
 *
 * To change the template for this generated file go to
 * Window>Preferences>Java>Code Generation>Code and Comments
 */
package com.lenovo;
import java.io.BufferedReader;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStreamReader;
/**
 * @author 23456
 *
 * To change the template for this generated type comment go to
 * Window>Preferences>Java>Code Generation>Code and Comments
 */
public class ReadFile {
 
 
 /**
   * @param args
   * @throws IOException
   */
  public static void main(String[] args) throws IOException {
    // BufferedReader buf=new BufferedReader(new FileReader("D:/d2.CSV") );
   BufferedReader buf = new BufferedReader(new InputStreamReader(
    new FileInputStream("d://winchillci1.csv"), "UTF-8"));
   System.out.println("Read under this dir English.txt");
   String line = null;
   int flag=1;
   while ((line = buf.readLine()) != null) {
     
    if(flag==1){
     line=line.substring(1);//去掉文件头
     flag++;
    }
   
    //System.out.println(line);
    String[] testString = line.split(",");
    for (int i = 0; i < testString.length; i++) {
     System.out.print(testString[i]);// 这个就是那个值
    }
    System.out.println();
   }
   buf.close();
  }
}
注意事项:
1. 接口双方一定要有备忘录,双方确认后再动工.
   基本公式: 文件编码:比如统一用UAF-8等等.
   文件格式:
2.不要让function顾问去谈编程技术相关的问题;
 
3.未得到对方编程人员的确认,不要改任何接口相关代码.
4.所有变动,都写到备忘录中.
5.接口工作用时长,要提早调通.要未雨绸缪,不可临渴掘井. 因为调通后还有大量的工作要做.(完)
 
附墨菲定律:
定理一:
工期比计划的要长;
定理二:
工作量比预想的要大;
定理三:
错误可能出到什么程度, 就一定会出到什么程度.
 
 
 
 
 
阅读(1708) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~