Author Topic: opening 200+ text files and combining them in one doc  (Read 1888 times)

Offline MamaMoose

  • TS Addict
  • Posts: 2105
    • View Profile
    • http://
opening 200+ text files and combining them in one doc
« on: April 30, 2009, 02:19:55 AM »
I have  280 small text files (~60 lines each, 72 characters per line). I want to open them all so that the files load in sequence into one document so I have a combined file containing all the files. I do not to load them manually one-by-one as that is very tedious.

Using a text editor, I can using Open,  put them in the editor's document list but they appear in the editor's window one at a time or on the desktop so I have to select them one at a time.

Is there any way I can open all the files within the single document without having to do so manually, that is automatically?

Thanks, MamaMoose
Ancient Graybeard Techsurvivors Founder
Dual 2 GHz PPCG5, 3.5 GB RAM, OS 10.4.8
Single core 1.5 GHz Intel Mini, 2 GB RAM, OS 10.4.8

Offline Texas Mac Man

  • TS Addict
  • *****
  • Posts: 1722
    • View Profile
    • http://
opening 200+ text files and combining them in one doc
« Reply #1 on: April 30, 2009, 08:23:04 AM »
There may be a way using Automator or an AppleScript, but I've never used either.

In the combined file, do each of the 280 text files need to be on separate pages?

It would be a one-time tedious task, but you could do the following:
1. Open each file sequentially, copy it, and paste it into a new combined file; or
2. Open each file & save it as a PDF file. Then use a utility app to combine individual PDFs into one PDF using PDFLab @ http://pdflab.en.softonic.com/mac

Cheers, Tom

Mac PRAM, NVRAM, CUDA/PMU & Battery Tutorial
https://sites.google.com/site/macpram/mac-p...attery-tutorial

Offline Mrious_be

  • TS Addict
  • *****
  • Posts: 3156
    • View Profile
    • http://www.marceldaems.com
opening 200+ text files and combining them in one doc
« Reply #2 on: April 30, 2009, 10:47:55 AM »
Or... you might find someone willing to do it for you wink.gif

Judging from what you want you simply want one large file, containing all 280 files in a certain order I assume.
This is pretty tedious as you said (and I don't know if there's anything that will do this appart from Automator as Tom pointed out) but it's honestly not that time consuming.
You'll probably be surprised how fast it goes by just opening them, and do a copy/paste in the new file and go on with the next file.
Actually... that might go faster than finding an answer on TS/Online smile.gif

Tom:
That software is really good to know/have.
We do have the full Acrobat Pro software but that takes so much space up for what it offers back (and for what it's used) that I can do those things with this software also.
I'm going to test this is and if it works nicely, I probably delete Adobe Acrobat smile.gif

Thanks

smile.gif
[img]http://dwdf.daisypath.com/a4ipp1.png\" border=\"0\" class=\"linked-sig-image\" /]

Offline Xairbusdriver

  • Administrator
  • TS Addict
  • *****
  • Posts: 26388
  • 27" iMac (mid-17), Big Sur, Mac mini, Catalina
    • View Profile
    • Mid-South Weather
opening 200+ text files and combining them in one doc
« Reply #3 on: April 30, 2009, 11:46:44 AM »
I still think an Apple Script would be easiest, especially if you already know how many documents there are, where they are, and how you want to combine them (blank line between documents, line of characters between each one, nothing, etc.). Frankly I've yet to find anything that Automator can do that doesn't require AS, anyway. It gets one close to what is needed but lacks basic for/else steps that are needed for so many things. wallbash.gif Variables are available but I've never seen a way to use them in a Loop or much of anything else. Probably just me. Anyway, give AS a try, you can point a script to the collection of files you want to use, make it open and copy the text, and paste it into a default document. That basic action, of course, needs to be repeated for each original document until all have been read and concatenated to the end of the previous one. Then, save the new, large file.

Of course, if you have FileMaker, it is a fairly simple task to import each document as a new, single field text record and then create a final record as the sum of each text record.

One other alternative is to teach your cat how to do his...
« Last Edit: April 30, 2009, 11:48:48 AM by Xairbusdriver »
THERE ARE TWO TYPES OF COUNTRIES
Those that use metric = #1 Measurement system
And the United States = The Banana system
CAUTION! Childhood vaccinations cause adults! :yes:

Offline tacit

  • TS Addict
  • *****
  • Posts: 1628
    • View Profile
    • http://www.xeromag.com/
opening 200+ text files and combining them in one doc
« Reply #4 on: April 30, 2009, 05:50:34 PM »
The free program TextWrangler can do this.

Create a new document. Click on the Edit menu and go to Insert->File Contents...

An Open dialog will appear. Shift-click your list of text files in the folder and hit Open. Bing! They will all be combined in alphabetical order.
A whole lot about me: www.xeromag.com/franklin.html

Offline jcarter

  • TS Addict
  • *****
  • Posts: 5808
    • View Profile
    • http://www.jcarter.net/ourdogs/muffinpage.html
opening 200+ text files and combining them in one doc
« Reply #5 on: May 01, 2009, 06:38:10 AM »
TextWrangler to the rescue!
 I also was wondering how to do this, I could put my lessons all into one document.
Thank you.
Jane

Offline Mrious_be

  • TS Addict
  • *****
  • Posts: 3156
    • View Profile
    • http://www.marceldaems.com
opening 200+ text files and combining them in one doc
« Reply #6 on: May 01, 2009, 07:04:08 AM »
Another interesting application biggrin.gif
[img]http://dwdf.daisypath.com/a4ipp1.png\" border=\"0\" class=\"linked-sig-image\" /]