-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathFile2.java
68 lines (68 loc) · 2.91 KB
/
File2.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
package Project2;
import Project1.*;
import java.time.format.DateTimeFormatter;
import java.time.LocalDateTime;
import java.util.*;
import java.io.*;
public class File2 {
public static void filepart(String fname,String sname,String dept,String enrollno,String valid,String bg,String add,String dob,String email,long phone1,long phone2)
{
if(dept.equals("CSE"))
dept="Computer Science & Engg.";
else if(dept.equals("ECE"))
dept="Electronics & Communication Engg.";
System.out.println(" भारतीय सूचना प्रौद्योगिकी संस्थान, नागपुर ");
System.out.println(" Indian Institute of Information Technology, Nagpur ");
System.out.println("An Institution of National Importance By An Act of Parliament");
System.out.println(" छात्र/Student");
System.out.println(fname+" "+sname);
System.out.println("-------------------");
System.out.println("विभाग/Department : "+dept);
System.out.println("पदवी/Degree : B.Tech");
System.out.println("आदेश क्रमांक/Enrollment No.:"+enrollno);
System.out.println("वैध/Valid Upto :"+valid);
System.out.println();
System.out.println(" भारतीय सूचना प्रौद्योगिकी संस्थान, नागपुर ");
System.out.println(" Indian Institute of Information Technology, Nagpur ");
System.out.println("An Institution of National Importance By An Act of Parliament");
System.out.println(" छात्र/Student");
System.out.print("रक्तगट/Blood Group : "+bg);
System.out.println(" स्थायी पता/Permanent Address :"+add);
System.out.print("गृह/Res.: "+phone1);
System.out.println(" ई-मेल/Email :"+email);
System.out.print("जन्म तिथि/DOB :"+dob);
DateTimeFormatter dtf = DateTimeFormatter.ofPattern("dd/MM/yyyy HH:mm:ss");
LocalDateTime now = LocalDateTime.now();
System.out.println(" जारी करने की तिथि/Issue On:"+dtf.format(now));
}
public String fname,sname,dept,enrollno,valid,bg,add,dob,email;
public long phone1,phone2;
public void filepart(String key,int c)
{
int year=2000+Integer.parseInt(key.substring(2,4));
String st="C:\\Users\\Gyanbardhan\\eclipse-workspace\\GYANBARDHAN\\BT"+(year-2000)+"\\"+key+".txt";
File fread=new File(st);
try {
Scanner sc=new Scanner(fread);
while(sc.hasNext())
{
fname=sc.next();
sname=sc.next();
dept=sc.next();
enrollno=sc.next();
valid=sc.next();
bg=sc.next();
add=sc.next();
phone1=sc.nextLong();
phone2=sc.nextLong();
dob=sc.next();
email=sc.next();
if(c!=-1)
filepart(fname,sname,dept,enrollno,valid,bg,add,dob,email,phone1,phone2);
}
} catch (FileNotFoundException e) {
//System.out.println(e);
System.out.println("File Not Found");
}
}
}