This Java Program helps in extracting the content form Notepad to Excel in a clear and alinged format
import javax.swing.*; import java.awt.event.*; import java.awt.*; import java.io.File; import java.util.*; public class DemoJFileChooserF extends JPanel implements ActionListener { JButton go; JTextField go1; JComboBox go2; JFileChooser chooser; String choosertitle; public DemoJFileChooserF() { go = new JButton("Start"); go1 = new JTextField(10); go2.addActionListener(this); go1.addActionListener(this); go.addActionListener(this); add(go); add(go1); } public void actionPerformed(ActionEvent e) { int result; chooser = new JFileChooser(); chooser.setCurrentDirectory(new java.io.File(".")); chooser.setDialogTitle(choosertitle); chooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY); // // disable the "All files" option. // chooser.setAcceptAllFileFilterUsed(false); // if (chooser.showOpenDialog(this) == JFileChooser.APPROVE_OPTION) { //System.out.println("getCurrentDirectory(): "+ chooser.getCurrentDirectory()); File curFolder = chooser.getSelectedFile(); File[] listofFiles = curFolder.listFiles(); if (listofFiles == null) { // Either dir does not exist or is not a directory } else { System.out.println("List Of Files......................"); for (int i=0; i<listofFiles.length; i++) { // Get filename of file or directory System.out.println(listofFiles[i].toString()); FileReadF.report(listofFiles[i].toString()); } } System.out.println("getSelectedFile() : " + chooser.getSelectedFile()); System.out.println(go1.getText()); System.out.println(go2.getSelectedItem()); } else { System.out.println("No Selection "); } } public Dimension getPreferredSize(){ return new Dimension(200, 200); } public static void main(String s[]) { JFrame frame = new JFrame(""); DemoJFileChooserF panel = new DemoJFileChooserF(); frame.addWindowListener( new WindowAdapter() { public void windowClosing(WindowEvent e) { System.exit(0); } } ); frame.getContentPane().add(panel,"Center"); frame.setSize(panel.getPreferredSize()); frame.setVisible(true); } }