Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

lady_kelacy

macrumors newbie
Original poster
Dec 30, 2017
1
0
What I am trying to find and/or figure out is how to import several text documents (.txt format) into a single document or spreadsheet. It would be preferable to also have an index of the imported files populated if at all possible. So far, I'm not having much luck, does anyone have any suggestions?
 
Well, sometimes the easiest way is to "do it the old-fashioned way":

1. Open "target" document and leave it open.
2. Open first document to import. Copy what's needed, then paste into target
3. Open second document to import. Repeat.
4. Repeat as required.
 
Open a term window.

cd $HOME/wherever/the/files/are
cp a.txt+b.txt+c.txt+d.txt combined.txt

Or, if you have a directory with ONLY the .txt files you want to combine (having files with other extension in the directory is OK) AND you want the files combined in alphabetical order:

cp *.txt combined.txt

Index doesn't really make any sense. There are no "pages" in .txt files. If you printed it, where the pages fall would depend on the font size you use when you print. So, not sure what you expect from an index.

You could write a program in some scripting language, and it wouldn't take much. Myself, I would use Ruby. Then, you could create an "index" that at least lists the file names that were included.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.