{
public static void main(String args[]) throws Exception
{
System.out.println("dd");
char c;
StringBuffer buf = new StringBuffer();
while((c=(char)System.in.read())!='\n')
buf.append(c);
buf.append('/n');
byte b[]=buf.toString().trim().getBytes();
RandomAccessFile f1 = new RandomAccessFile("zz.txt","rw");
f1.seek(f1.length());
f1.write(b);
f1.close();
}
}
public static void main(String args[]) throws Exception
{
System.out.println("dd");
char c;
StringBuffer buf = new StringBuffer();
while((c=(char)System.in.read())!='\n')
buf.append(c);
buf.append('/n');
byte b[]=buf.toString().trim().getBytes();
RandomAccessFile f1 = new RandomAccessFile("zz.txt","rw");
f1.seek(f1.length());
f1.write(b);
f1.close();
}
}
sorry 好像反了。
buf.append(c);
out.println(buf.toString());
可以试试看。
就读到excel里,调用它的函数排序再写回去喽
用jxl包可以做到
public class zcy
{
public static void main(String args[]) throws Exception
{ System.out.println("dd");
char c;
StringBuffer buf = new StringBuffer();
while((c=(char)System.in.read())!='\n')
buf.append(c);
byte b[]=buf.toString().trim().getBytes();
RandomAccessFile f1 = new RandomAccessFile("zz.txt","rw");
f1.seek(f1.length());
f1.write(b);
f1.writeBytes( System.getProperty( "line.separator" ) );
f1.close();
}
}