jascoken
Senior Member
- Nov 1, 2010
- 1,135
- 753
Guys
I come across a lot of SEO's who're working with masses of scraped URL lists etc. and need an easy way of combining them into one file for a mass import etc. Many people don't know much about DOS/CLI in windows, but this one line does the job...
First... How to get into the command mode etc if you don't already know...
Windows Key + R = 'Run' (or START:Run)
Type 'CMD' & ENTER to get to the command prompt
Type 'CD C:\Users\whoever\My Documents\blah\blah...' & ENTER to change to the directory where the files are stored. (Hint: If you're in windows explorer and you click on the folder icon top left, next to the windows path, it will become the actual full directory path which you can copy and paste. Paste it into the command box by using right-click and paste - CTRL V won't work.)
Now 'DIR' & ENTER will show you the directory of files (so you can check etc.)
Many of you will know all this so far.... So here's the important command to do the work:
for %f in (*.txt) do type "%f" >> new.txt
...this quite simply loops and copies ('types') any text files (with extension '.txt'), one-by-one into another text file called 'new.txt'
You can play with this with other plain-text file extensions obviously and change the end file name if you want!
I come across a lot of SEO's who're working with masses of scraped URL lists etc. and need an easy way of combining them into one file for a mass import etc. Many people don't know much about DOS/CLI in windows, but this one line does the job...
First... How to get into the command mode etc if you don't already know...
Windows Key + R = 'Run' (or START:Run)
Type 'CMD' & ENTER to get to the command prompt
Type 'CD C:\Users\whoever\My Documents\blah\blah...' & ENTER to change to the directory where the files are stored. (Hint: If you're in windows explorer and you click on the folder icon top left, next to the windows path, it will become the actual full directory path which you can copy and paste. Paste it into the command box by using right-click and paste - CTRL V won't work.)
Now 'DIR' & ENTER will show you the directory of files (so you can check etc.)
Many of you will know all this so far.... So here's the important command to do the work:
for %f in (*.txt) do type "%f" >> new.txt
...this quite simply loops and copies ('types') any text files (with extension '.txt'), one-by-one into another text file called 'new.txt'
You can play with this with other plain-text file extensions obviously and change the end file name if you want!