Google Answers Logo
View Question
 
Q: Batch printing or batch importing 300 small text files. ( No Answer,   3 Comments )
Question  
Subject: Batch printing or batch importing 300 small text files.
Category: Computers > Software
Asked by: treemandew-ga
List Price: $10.00
Posted: 20 Apr 2005 15:54 PDT
Expires: 20 May 2005 15:54 PDT
Question ID: 512011
I need a method to batch print the contents of 300 small text files,
many of them containing only one or two lines of text, along with
their file names so it's clear at a glance which lines of text are in
which file. This would require printing many files to a page. Ideally
the printout would have two columns: a narrow one listing the file
names down the left side of the page, and a wide column on the right
containing the contents of the text file.  A print utility that does
this would be one approach.  A better approach would be a method of
mass importing the files into some sort of a document that can be read
and printed with common Windows applications.

Request for Question Clarification by pafalafa-ga on 20 Apr 2005 20:06 PDT
What!!!  You don't grok grep?

Here's another approach, which I'm not posting as an answer since it's
99% -- but not 100% -- of what you asked for.

The freeware program TxtCollector:


http://bluefive.pair.com/txtcollector.htm



allows you to easily combine a ton of text files into a single file,
and inserts the file name along with the text of each file.  It also
puts a seperator of your choice (e.g. =======) between files.

I don't know if it allows you to create the type of columns you
mentioned -- file name in one column, text in the other -- which is
the part that makes it not quite 100%.


Let me know what you think.


pafalafa-ga

Request for Question Clarification by pafalafa-ga on 20 Apr 2005 20:36 PDT
Just to be clear, the grep info was not posted by me (a GA
researcher), but by one of the many commenters that frequent the pages
of Google Answers.

paf
Answer  
There is no answer at this time.

Comments  
Subject: Re: Batch printing or batch importing 300 small text files.
From: bozo99-ga on 20 Apr 2005 16:08 PDT
 
grep '' *

That's a grep for the empty string between 2 single quote marks and
will produce output like:

file1:Thu Apr 21 00:05:39 BST 2005
file2:Thu Apr 21 00:05:43 BST 2005
file2:words here

redirect that into a file in another directory and that's your text file.
Transferring it to your windows box is outside the scope of the question.
Subject: Re: Batch printing or batch importing 300 small text files.
From: treemandew-ga on 20 Apr 2005 19:17 PDT
 
I have absolutely NO idea what this guy is talking about!
Subject: Re: Batch printing or batch importing 300 small text files.
From: dmrmv-ga on 21 Apr 2005 14:40 PDT
 
"I have absolutely NO idea what this guy is talking about!"

grep is a utility commonly found on Unix-like operating systems and
available for Windows if you google. It is used to find text (regular
expressions actually) in files. If you run the command as posted it
will search every file in a directory for the empty string, and
basically match everything. grep prints out a line for each line that
matches the search pattern, preceded by the filename and a colon, so
basically you would end up with almost what you're asking: a column
containing the filename, then a colon, then a line of text from the
file. The only problems (possibly) are that a filename is printed out
on every line, and the lines of text will be staggered depending on
the length of the filename (although grep may have options that would
solve these, or you could search and replace the colon with a tab
character).

Redirecting to a file just means that instead of having the output
from grep appear on the screen it would be written to a file, and of
course you would want that file to be in a different directory so grep
didn't try to read the file it was writing to, although with the
version I have it doesn't anyway.

Important Disclaimer: Answers and comments provided on Google Answers are general information, and are not intended to substitute for informed professional medical, psychiatric, psychological, tax, legal, investment, accounting, or other professional advice. Google does not endorse, and expressly disclaims liability for any product, manufacturer, distributor, service or service provider mentioned or any opinion expressed in answers or comments. Please read carefully the Google Answers Terms of Service.

If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you.
Search Google Answers for
Google Answers  


Google Home - Answers FAQ - Terms of Service - Privacy Policy