Win a copy of Terraform in Action this week in the Cloud forum!

sam mukhtari

Greenhorn
+ Follow
since May 31, 2004
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by sam mukhtari

Tim and Ernest, i have followed your lead and tried to write the program step by step, how ever when i wrote the read part sepertly and then the print write seperatly i can't seem to connect the two and don't know where the manipulation part of the text should be at..here it is so far:

import java.io.*;
import java.io.BufferedReader;
import java.io.FileReader;

class temp

public static void main(string args[])

throws IOException {

File f = new File(args[0]);
FileReader fr = new FileReader(f);
BufferedReader br = new BufferedReader(fr);
PrintWriter pw = new PrintWriter( new FileWriter( "summary.txt" ) );
int date;
finale float MAX = 350;
finle float MIN = 100;
float times, temperatures;



void readMyFile() {

DataInputStream dis = null;
String record = null;
int recCount = 0;

try {

File f = new File("mydata.txt");
FileInputStream fis = new FileInputStream(f);
BufferedInputStream bis = new BufferedInputStream(fis);
dis = new DataInputStream(bis);

while ( (record=dis.readLine()) != null ) {
recCount++;
System.out.println(recCount + ": " + record);
}

} catch (IOException e) {
// catch io errors from FileInputStream or readLine()
System.out.println("Uh oh, got an IOException error!" + e.getMessage());

} finally {

if (dis != null) {
try {
dis.close();
} catch (IOException ioe) {
}
}
}


}
}
public class PrintWrite

{
public static void main( String[] args )
{
PrintWriter out = new PrintWriter( new FileWriter( "summary.txt" ) );
for

( int i=0 ; i <= 100 ; i++ )

out.close();
}

}






SimpleDateFormat sdf1 = new SimpleDateFormat("ddmmyyyy");
SimpleDateFormat sdf2 = new SimpleDateFormat("dd/mm/yyyy");
Date date = sdf1.parse("09032004");System.out.println(sdf2.format(date));




}
17 years ago