1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. Hey Guest Last month we upgraded BlackHatWorld.com to a new platform - . If you notice anything that requires attention please start a new thread here.
    Dismiss Notice

[TUTORIAL] Easy merging lots of text files - one line of code....

Discussion in 'Black Hat SEO Tools' started by jascoken, Feb 9, 2013.

  1. jascoken

    jascoken Senior Member

    Joined:
    Nov 1, 2010
    Messages:
    1,135
    Likes Received:
    751
    Gender:
    Male
    Occupation:
    IT/Web Systems & Development...
    Location:
    Sussex:UK
    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!
     
  2. HatIsBlacked

    HatIsBlacked Regular Member

    Joined:
    Dec 30, 2010
    Messages:
    222
    Likes Received:
    54
    your in the wrong forum. post this in the programming forum. this is for blackhat software tools, not how to do dos batch commands.