How to combine text files into one with single file with Windows command

Here is the simplest way you can combine multiple text files into one single file.

  1. Move all the text files you want to be merged into one folder.
  2. Move that folder to C:\ and name it “temp”.
  3. Rename all the text files in order such as text1.txt, text2.txt text3.txt etc.
  4. Open command prompt by clicking start and typing “cmd”.
  5. Once the black box pops up type the following “cd..” and click enter. Type “cd..” once more and click enter.
  6. Now type “cd temp” and click enter.
  7. Now that we are in the correct folder to type the command to combine all the text files into one.
  8. Type the following “copy *.txt target.txt” – you can replace “target.txt” with whatever you want the new combined file to be named.

Once completed you will now have everything in one single .txt file.

How to disable automatic restart on Blue Screen of Death in Windows 7

If you are getting the Blue Screen of Death in your Windows 7 IOS and want to disable that so you can find the cause of it, follow these simple little steps.

  1. Right-click on Computer, select Properties.
  2. Click Advanced System Settings.
  3. On the Advanced tab, under “Startup and Recovery”, click “settings”.
  4. Under “System Failure”, uncheck the box next to “automatic restart”.

How to convert from Movable Type to WordPress

This tutorial was written on WordPress 3.4.1 and works as of WordPress 3.4.1.

Part 01 – Installations

  1. Install a FRESH copy of WordPress (http://www.wordpress.org/)
  2. Login to your Movable Type site and export your blog posts. You will be prompt to save a .txt file, which is what you want.
  3. Install the “Movable Type” converting plugin (http://wordpress.org/extend/plugins/movabletype-importer/).

Part 02 – Plugin and Export Changes

Once the plugin is installed we are going to have to edit the plugin and add in the necessary changes to accommodate line spacing because, line spacing in the vanilla plugin isn’t correct and wont register line spacing like it should.

Open wp-content/plugins/movabletype-importer/movabletype-importer.php, find the following:

				// Processing multi-line field, check context.

				if( !empty($line) )
					$line .= "\n";

Replace with the following:

				// Processing multi-line field, check context.

				if( !empty($line) )
					$line .= "\n\n";

Now we will need to edit the exported .txt file from your previous Movable Type installation. Open your exported .txt file and search for the following:

CONVERT BREAKS: __default__

Change the above to the following:

CONVERT BREAKS: 1

Note: There are more than one instance of this and should be mass changed. I suggest going up to “edit” then “replace” and mass replacing the instance, notepad works great for this. Once you are done, save and continue on to step 03.

Step 03 – Uploading Export and Running Conversion

Now that we have made the necessary changes – we are going to want to upload the .txt file to your WordPress folder.

  1. Rename your exported Movable Type .txt file to “mt-export.txt”. This must be named just that or the importer won’t accept it.
  2. Upload “mt-export.txt” to the root of /wp-content/
  3. Once your upload is done – login to your WordPress admin and navigate to /wp-admin/ » Tools » Import » Movable Type and TypePad
  4. Once there click “Import mt-export.txt”

You will be prompt to merge your old usernames into new accounts on WordPress. If the authors are already registered you can select there names from the drop down list. If the authors are not current registered members of your WordPress blog – you can Type there new names in or merge all posts into your account.

Note: If you have a huge blog, depending on your web host the importer might time out. This is fine because, the importer has a feature to not import duplicates BUT when you go back to re import it will prompt you again to type in the new authors. Remember what you did with the previous settings and reapply them. The importer will skip the duplicate article and proceed where it left off.

Repeat this again and again if the importer times out. It will eventually import everything.

Step 04 – Mass Editing Article Slugs

I’ve noticed that after my successful import the article slugs were cut off and had annoying underscores in the actual link. Thanks to “Clorith” from the WordPress IRC Channel – he already had a script that would fix this issue on a mass change level. As you can imagine editing 2,000+ articles would take a long unneeded time.

Read “How to mass change article slug URLs in WordPress” on how to achieve this.

Step 05 – Changing Loose Comment Author ID’s

This step is optional but if you have comments and specially you or another made them, your going to want to make sure the comment ids are linked to your account. Specifically for later use with various addons.

  1. Login to your phpMyAdmin inside cPanel if you use cPanel.
  2. Navigate to your WordPress table and click the “SQL” tab.

Now I have found it easier to select and update by comment_author_email since it’s unique to you.

UPDATE HYv3g_comments SET user_id = '1' WHERE comment_author_email='YOUR EMAIL';

Repeat the above for any other authors you want to mass change or if you used more than one email to comment. Also make sure to change the user_id to the correct user id you are updating.

This concludes the tutorial and if you have any questions feel free to comment. If you are looking for your Movable Type blog to be professionally moved to WordPress feel free to contact us for a quote.

How to list page or category links in WordPress

These simple peices of code will allow you to display page or category links in your WordPress theme.

To list pages use the following code:

You can exclude specific pages by changing the above code to the following:

Just replace 1 with the ID of the page and add a coma to list more than one.

To list categories use the following code:

You can exclude specific categories by changing the above code to the following:

Just replace 1 with the ID of the category and add a coma to list more than one.

How to mass change article slug urls in WordPress

This piece of PHP code will mass change your WordPress slug links to default slugs WordPress would normally generate from your article titles.

Open wp-config.php, add the following at the bottom:

Save and upload your new wp-config.php and load your home page only one time. Once the loading is completed, remove the code from your wp-config.php file.

Credits: Clorith @ https://github.com/Clorith/wp-slug-update


Google PageRank