The Artima Developer Community
Sponsored Link

Java Answers Forum
writing to a file

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
George

Posts: 10
Nickname: swiftcrash
Registered: Nov, 2002

writing to a file Posted: Nov 14, 2002 7:32 PM
Reply to this message Reply
Advertisement
anyone knows how to make the record below fixed to 256 chars and then position each var to certain offset and length. is it

in.write(1,6); as in.write(position, length)
how can i define the record size to 256 characters only?

thanx for the help, the code is below...
i am reading the variables and writing them but i do not want
each record to go up more than 256 and is there a way to write
a ctrl/linefeed at the end

in.write(ctrl/linefeed)?
is it in.nextLine();?


public void WriteFile(String AStateCode,String AProjId,String ArecordType,
String Afillera,String AactionType,String Afillerb){
try{
BufferedWriter in = new BufferedWriter(new FileWriter (afile.getPath(),true));
in.write(AStateCode);
in.write(AProjId);
in.write(Arec ordType);
in.write(Afillera);
in.write(AactionType);
in.write(Afillerb);
in.clos e();

}catch(IOException e){
System.out.println("ERROR:writing to the file" + e.getMessage());
}
}

thank you all

Topic: java program Previous Topic   Next Topic Topic: help with the display when printed

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use