Create a text file by printing
Tuesday, April 06th, 2010 | Author: Bruce

Every so often I have been faced with a problem where I need to export data from a program that doesn’t have an export capability.  I suppose I could print to paper and then scan it in, but that is harder than need be.  Instead, I create a generic ‘text’ printer on the Windows machine and then use it to print to file.To do this, go through these steps:

  1. Control Panel -> Printers and Faxes
  2. Add a Printer – the wizard will start.
  3. Select Local Printer
  4. Select Local Port – such as LPT1 – it doesn’t matter.
  5. Don’t let it search for a printer, as it won’t find it.
  6. Select GENERIC TEXT PRINTER – it’s the first entry in the list.
  7. Give it a name, such as PRINT TO FILE

Having set it up, run your application and select print.  Then select the TEXT PRINTER and click the PRINT TO FILE check box.

Click PRINT and you will be asked to provide a filename (and folder, it will probably be in My Documents)

You will end up with a .TXT file that you can then work with.

Now you may wonder why you don’t use the “Print to File” check with your normal printer.  The reason you nomrally don’t do this is that the output will not be plain text, but rather the code specific to your printer – not something that is easily read by a program.

Category: Printing