import java.io.*; public class Linking { // ************************************************************ // * * // * main Method * // * * // ************************************************************ public static void main(String[] args) throws Exception { System.out.println("\n * * * Welcome to the Program * * * \n"); /*CALL*/readFile(); System.out.println("\n * * * End of the Linking * * * \n"); } // ************************************************************ // * * // * readFile Method * // * * // ************************************************************ public static void readFile() { String firstLineSt=""; String secondLineSt=""; try // Read the INPUT FILE { FileReader inputFileReader = new FileReader("Num.txt"); BufferedReader inputFileBuffer = new BufferedReader(inputFileReader); firstLineSt=inputFileBuffer.readLine(); secondLineSt=inputFileBuffer.readLine(); System.out.println(firstLineSt); System.out.println(secondLineSt); writeFile(firstLineSt,secondLineSt); firstLineSt=secondLineSt; while(true) // Until the end of the input file { secondLineSt=inputFileBuffer.readLine(); if(firstLineSt==null) // End of the input file { break; } System.out.println(firstLineSt); System.out.println(secondLineSt); writeFile(firstLineSt,secondLineSt); firstLineSt=secondLineSt; } // End of the WHILE loop (End of the file) inputFileReader.close(); } // End of the TRY catch(FileNotFoundException e) { System.out.println("Unable to Open INPUT File"); } catch(IOException e) { System.out.println("Unable to Close INPUT File"); } } // ************************************************************ // * * // * writeFile Method * // * * // ************************************************************ public static void writeFile(String tempSt1,String tempSt2) { char backslash=92; String umlword="UML"; String firstPartPath=umlword+backslash; String filePath1=""; String filePath2=""; filePath1=firstPartPath.concat(tempSt1).concat(".html"); filePath2=firstPartPath.concat(tempSt2).concat(".html"); // System.out.println(filePath1); // System.out.println(filePath2); tempSt1=(char)10+"