ArtsAutosBooksBusinessEducationEntertainmentFamilyFashionFoodGamesGenderHealthHolidaysHomeHubPagesPersonal FinancePetsPoliticsReligionSportsTechnologyTravel

Niche Refinery tips crunch and combine/merge csv files in seconds using a simple DOS batch file

Updated on March 4, 2012

The Niche refinery is a powerful tool made by the creators of the Keyword Academy and if you are interested in SEO then the methods found there are simple and powerful.  What I found though was that rather than just dumping tens of thousands of raw keywords and phrases into the Niche Refinery I wanted to do a little pre-sorting and trim away some of the keywords and phrases that were below the monthly target.  

If I wanted to do this though then I would have to take the zipped csv files I obtained from Google’s keyword tool and spend absolutely ages merging the csv’s before doing any work.  I wasn’t really interested in spending lots of time on this so I did a little research and came up with the following tips.

Tip #1 – Get the csv’s out of the zip files in seconds

This little tip is great for anyone who works with a lot of zip files and has sat and extracted each of them one by one. After reading this you will never do this again.

  1. Rather than opening each zip file simply highlight all of the zip files in a folder and right-click.
  2. If you have any kind of zip software on your PC then you should get an “extract here” option.
  3. Click on the “Extract here” and all of the contents of the zip files will be dumped into the same folder that the zip files were in.

I have included a slideshow below showing how to do this.

Click thumbnail to view full-size

Tip #2 – Merge the csv files in seconds

So the slow way to get all of your csv files together would be to open them all and then select all the data from each and copy them into a new csv or excel document…

…one by one…

Instead you can simply use a DOS command to merge them all together! To save you doing some more complicated DOS work I have put together a simple batch file. To use the batch file just follow the net set of instructions. If you want to do the more complicated DOS work then check out the next section.

The Batch File

  1. To use this batch file open a text document on your computer and name it “CSV merger” or something along those lines.
  2. Close the document and rename the file “CSV merger.bat”
  3. This will probably generate a warning from your computer that changing a file extension will make it unstable and in some cases it will. But not this time!
  4. Now right click on your CSV Merger and choose to edit it. This will open it as a text file
  5. Now paste the following code into the file and then save and close
  6. To use this batch file open a text document on your computer and name it “CSV merger” or something along those lines.
  7. Close the document and rename the file “CSV merger.bat”
  8. This will probably generate a warning from your computer that changing a file extension will make it unstable and in some cases it will. But not this time!
  9. Now right click on your CSV Merger and choose to edit it. This will open it as a text file
  10. Now paste the following code into the file and then save and close:

ECHO OFF
:MENU
CLS
ECHO V1.0 Mark Barnes, www.BunduBrain.com
ECHO .
ECHO ...................................................
ECHO .. PLEASE CHOOSE AN OPTION FROM THE MENU ..
ECHO ...................................................
ECHO.
ECHO 1 - Merge all .csv files in a folder
ECHO.
ECHO x - EXIT
ECHO.
ECHO ...................................................
ECHO.
SET /P M= Type your choice and then press ENTER:% 
IF %M%==1 GOTO MERGE
IF %M%==x GOTO EOF
GOTO MENU

:MERGE
CLS
ECHO.
ECHO ...................................................
ECHO .. Please enter the drive letter for the drive ..
ECHO .. the csv's are on e.g "C" for C:\ ..
ECHO ...................................................
ECHO.
SET /P DLETTER= Drive Letter:% 
ECHO.
ECHO ...................................................
ECHO .. Please enter the path of the folder the csv ..
ECHO .. files are located in e.g Zip\Zip Test ..
ECHO ...................................................
ECHO.
SET /P LOCATION= Folder Path:% 
ECHO.
ECHO ...................................................
ECHO .. Please choose a name for the merged csv ..
ECHO ...................................................
ECHO.
SET /P MERGED= Name of Output File:% 
CLS
ECHO.
@echo off
cd %DLETTER%:\%LOCATION%
copy *.csv %MERGED%.csv
GOTO CHOOSE


:CHOOSE
ECHO.
ECHO ...................................................
ECHO .. Type m to return to the menu, or x to exit ..
ECHO ...................................................
ECHO.
SET /P M= Please Choose:% 
IF %M%==m GOTO MENU
IF %M%==M GOTO MENU
IF %M%==x GOTO EOF
IF %M%==X GOTO EOF
GOTO CHOOSE

Doing the DOS work yourself

Okay so if you want to know how to do this using DOS then this section is for you.

  1. Start by copying all the csv files to a folder on the root of your hard drive. The reason for this is later on you won’t have to enter a long file path!
  2. Now open your “Run” file to access the DOS window. You can do this on an XP system by choosing “Run” from the start menu. On Vista and Windows 7 you should be able to just search for “Run”
  3. Once the DOS window is open you need to move to the folder where your csv files are stored. To do this you will use the “CD” (Choose Directory) function. For the purposes of this example I have moved all of my csv files into the folder c:\Zip.
  4. So to change to that folder I would enter “cd c:\Zip” (without the quotes!)
  5. Now simply enter the following: copy *.csv merged.csv
  6. This will take any csv file in this folder and merge it into a file name “merged.csv”. It will leave all of the originals intact

Comments

    0 of 8192 characters used
    Post Comment

    • ilmdamaily profile image

      ilmdamaily 

      7 years ago from A forgotten corner of a dying empire. OK, it's Australia :-)

      This is an incredibly useful tip - thanks mate! Was just contemplating ways to streamline this part of the process with Niche Refinery, and this has saved me having to outsource any of that process.

      More money for me:-)

      Keep it up!

    working

    This website uses cookies

    As a user in the EEA, your approval is needed on a few things. To provide a better website experience, hubpages.com uses cookies (and other similar technologies) and may collect, process, and share personal data. Please choose which areas of our service you consent to our doing so.

    For more information on managing or withdrawing consents and how we handle data, visit our Privacy Policy at: https://hubpages.com/privacy-policy#gdpr

    Show Details
    Necessary
    HubPages Device IDThis is used to identify particular browsers or devices when the access the service, and is used for security reasons.
    LoginThis is necessary to sign in to the HubPages Service.
    Google RecaptchaThis is used to prevent bots and spam. (Privacy Policy)
    AkismetThis is used to detect comment spam. (Privacy Policy)
    HubPages Google AnalyticsThis is used to provide data on traffic to our website, all personally identifyable data is anonymized. (Privacy Policy)
    HubPages Traffic PixelThis is used to collect data on traffic to articles and other pages on our site. Unless you are signed in to a HubPages account, all personally identifiable information is anonymized.
    Amazon Web ServicesThis is a cloud services platform that we used to host our service. (Privacy Policy)
    CloudflareThis is a cloud CDN service that we use to efficiently deliver files required for our service to operate such as javascript, cascading style sheets, images, and videos. (Privacy Policy)
    Google Hosted LibrariesJavascript software libraries such as jQuery are loaded at endpoints on the googleapis.com or gstatic.com domains, for performance and efficiency reasons. (Privacy Policy)
    Features
    Google Custom SearchThis is feature allows you to search the site. (Privacy Policy)
    Google MapsSome articles have Google Maps embedded in them. (Privacy Policy)
    Google ChartsThis is used to display charts and graphs on articles and the author center. (Privacy Policy)
    Google AdSense Host APIThis service allows you to sign up for or associate a Google AdSense account with HubPages, so that you can earn money from ads on your articles. No data is shared unless you engage with this feature. (Privacy Policy)
    Google YouTubeSome articles have YouTube videos embedded in them. (Privacy Policy)
    VimeoSome articles have Vimeo videos embedded in them. (Privacy Policy)
    PaypalThis is used for a registered author who enrolls in the HubPages Earnings program and requests to be paid via PayPal. No data is shared with Paypal unless you engage with this feature. (Privacy Policy)
    Facebook LoginYou can use this to streamline signing up for, or signing in to your Hubpages account. No data is shared with Facebook unless you engage with this feature. (Privacy Policy)
    MavenThis supports the Maven widget and search functionality. (Privacy Policy)
    Marketing
    Google AdSenseThis is an ad network. (Privacy Policy)
    Google DoubleClickGoogle provides ad serving technology and runs an ad network. (Privacy Policy)
    Index ExchangeThis is an ad network. (Privacy Policy)
    SovrnThis is an ad network. (Privacy Policy)
    Facebook AdsThis is an ad network. (Privacy Policy)
    Amazon Unified Ad MarketplaceThis is an ad network. (Privacy Policy)
    AppNexusThis is an ad network. (Privacy Policy)
    OpenxThis is an ad network. (Privacy Policy)
    Rubicon ProjectThis is an ad network. (Privacy Policy)
    TripleLiftThis is an ad network. (Privacy Policy)
    Say MediaWe partner with Say Media to deliver ad campaigns on our sites. (Privacy Policy)
    Remarketing PixelsWe may use remarketing pixels from advertising networks such as Google AdWords, Bing Ads, and Facebook in order to advertise the HubPages Service to people that have visited our sites.
    Conversion Tracking PixelsWe may use conversion tracking pixels from advertising networks such as Google AdWords, Bing Ads, and Facebook in order to identify when an advertisement has successfully resulted in the desired action, such as signing up for the HubPages Service or publishing an article on the HubPages Service.
    Statistics
    Author Google AnalyticsThis is used to provide traffic data and reports to the authors of articles on the HubPages Service. (Privacy Policy)
    ComscoreComScore is a media measurement and analytics company providing marketing data and analytics to enterprises, media and advertising agencies, and publishers. Non-consent will result in ComScore only processing obfuscated personal data. (Privacy Policy)
    Amazon Tracking PixelSome articles display amazon products as part of the Amazon Affiliate program, this pixel provides traffic statistics for those products (Privacy Policy)