Q:

Webdriver script won't print to text file

Issue:
My Java WebDriver script is creating the text file, printing everything to console properly, but will not print to the said text file. The file is always blank.
My Observation:
It's got some to do with how I have written the buffered writer write() and close() functions, but I can't quiet place my finger on it being a noob. All help is highly appreciated.
My Code:
public class WebTableToTxtFile {
    static WebDriver driver = new FirefoxDriver();

    public static void main(String[] args) throws Throwable {
        driver.navigate().to("http://www.bloomberg.com/markets/stocks/futures");
        driver.manage().window().maximize();
        driver.manage().timeouts().implicitlyWait(20, TimeUnit.SECONDS);

        WebElement table = driver.findElement(By.cssSelector("div[class='data-tables first']"));
        List<WebElement> irow = table.findElements(By.cssSelector("div[class='data-tables first'] tr"));
        System.out.println("No. of rows in the table are: " + irow.size());

        File txtFile = new File("MyFileLocation/Output.txt");

        for (int r = 0; r < irow.size(); r++) {
            WebElement webRow = irow.get(r);
            System.out.print(webRow.getText());
            List<WebElement> allCells = webRow.findElements(By.xpath("th | td"));

            for (int c = 0; c < allCells.size(); c++) {
                WebElement webCell = allCells.get(c);
                String text = webCell.getText();
                System.out.print(text);

                FileWriter fw = new FileWriter(txtFile.getAbsolutePath());
                BufferedWriter bw = new BufferedWriter(fw);

                bw.write(text);
                bw.close();
            }
            System.out.println("");
        }

        end();
    }

    public static void end() {
        driver.close();
        driver.quit();
    }
}

A:

The problem is that each time you are calling your code
FileWriter fw = new FileWriter(txtFile.getAbsolutePath());
BufferedWriter bw = new BufferedWriter(fw);
bw.write(text);
bw.close();

It is rewriting the file, not adding a line.
And you are calling it for each element found, so just the one last value is saved in the file which happens to be empty.
I suggest you first to build the String you want to store in the file, and then write it to the file. Like this:
public class WebTableToTxtFile {
    static WebDriver driver = new FirefoxDriver();

    public static void main(String[] args) throws Throwable   {
        driver.navigate().to("http://www.bloomberg.com/markets/stocks/futures");
        driver.manage().window().maximize();
        driver.manage().timeouts().implicitlyWait(20, TimeUnit.SECONDS);

        WebElement table = driver.findElement(By.cssSelector
                ("div[class='data-tables first']"));

        List<WebElement> irow = table.findElements
                (By.cssSelector("div[class='data-tables first'] tr"));
        System.out.println("No. of rows in the table are: " + irow.size());

        File txtFile = new File
                ("MyFileLocation/Output.txt");
        StringBuilder sb = new StringBuilder();

        for(int r=0; r<irow.size(); r++) {
            WebElement webRow = irow.get(r);
            System.out.print(webRow.getText());

            List<WebElement> allCells = webRow.findElements(By.xpath("th | td"));

            for(int c=0; c<allCells.size(); c++) {
                WebElement webCell = allCells.get(c);
                String text = webCell.getText();
                System.out.print(text);
                sb.append(text + '\n');
            }

            System.out.println("");

        }

        FileWriter fw = new FileWriter(txtFile.getAbsolutePath());
        BufferedWriter bw = new BufferedWriter(fw);
        bw.write(sb.toString());
        bw.close();

        end();
    }
    public static void end() {
        driver.close();
        driver.quit();
    }
}

