<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
<title>Snipplr</title>
<link>http://snipplr.com/tags/batch</link>
<description>Recent snippets posted on Snipplr.com</description>
<language>en-us</language>
<pubDate>Wed, 22 May 2013 14:07:58 GMT</pubDate>
<item>
<title>(SQL) Bulk insert/upload microsoft sql server (csv) - dego89</title>
<link>http://snipplr.com/view/71212/bulk-insertupload-microsoft-sql-server-csv/</link>
<description><![CDATA[ <p>Bulk upload a CSV into Microsoft SQL Server</p> ]]></description>
<pubDate>Fri, 17 May 2013 04:03:48 GMT</pubDate>
<guid>http://snipplr.com/view/71212/bulk-insertupload-microsoft-sql-server-csv/</guid>
</item>
<item>
<title>(DOS Batch) Batch code to process files with a certain filename in a directory - stianlagstad</title>
<link>http://snipplr.com/view/70562/batch-code-to-process-files-with-a-certain-filename-in-a-directory/</link>
<description><![CDATA[ <p>This will loop through files in somefolder with the extension .c, print out the filename and compile the files.</p> ]]></description>
<pubDate>Wed, 27 Mar 2013 04:08:03 GMT</pubDate>
<guid>http://snipplr.com/view/70562/batch-code-to-process-files-with-a-certain-filename-in-a-directory/</guid>
</item>
<item>
<title>(Bash) batch rename in subdirectories - lafayette</title>
<link>http://snipplr.com/view/69695/batch-rename-in-subdirectories/</link>
<description><![CDATA[ <p>rename all files in subdirectories from .cpp to .c</p> ]]></description>
<pubDate>Wed, 30 Jan 2013 02:37:03 GMT</pubDate>
<guid>http://snipplr.com/view/69695/batch-rename-in-subdirectories/</guid>
</item>
<item>
<title>(DOS Batch) DOS Batch example template - imbraz</title>
<link>http://snipplr.com/view/67223/dos-batch-example-template/</link>
<description><![CDATA[ <p>An exmaple DOS batch  file</p> ]]></description>
<pubDate>Tue, 18 Sep 2012 19:10:29 GMT</pubDate>
<guid>http://snipplr.com/view/67223/dos-batch-example-template/</guid>
</item>
<item>
<title>(Java) Learning JAVA (with basic standalone code snippets) - bcmoney</title>
<link>http://snipplr.com/view/66769/learning-java-with-basic-standalone-code-snippets/</link>
<description><![CDATA[ <p>Just some random stuff I worked through myself and used a long time ago to get up to speed with Java in University. 

If you can understand these basic samples by actually running them and experimenting, then you'll be set to do more in-depth programming.</p> ]]></description>
<pubDate>Fri, 17 Aug 2012 00:35:21 GMT</pubDate>
<guid>http://snipplr.com/view/66769/learning-java-with-basic-standalone-code-snippets/</guid>
</item>
<item>
<title>(Python) Getting shovel to work in windows so python methods can be run like individual executables - pckujawa</title>
<link>http://snipplr.com/view/66267/getting-shovel-to-work-in-windows-so-python-methods-can-be-run-like-individual-executables/</link>
<description><![CDATA[ <p>I had hear about a method to run a method like an executable, with the arguments being passed in from the commandline. Apparently, Ruby has this with the Rake project. Well, Python has it with [Shovel](http://devblog.seomoz.org/2012/03/shovel-rake-for-python). Only the instructions didn't work for me on windows, so I had to create a batch script to call `shovel` correctly.

So here's my setup. I installed shovel using `easy_install shovel`, which placed it in my python scripts folder (C:\Python27\Scripts, which is in my PATH). I created 'shovel.bat' (see source) in the same folder. So now I can call `shovel` from anywhere and it will call my batch file, passing the parameters into shovel.

For completeness, here is my working directory structure (note the subfolder called shovel):

	D:.
	│   song log.log
	│   Untitled_10.mp3
	│   Untitled_11.mp3
	│   Untitled_2.mp3
	│   Untitled_3.mp3
	│   Untitled_4.mp3
	│   Untitled_5.mp3
	│   Untitled_6.mp3
	│   Untitled_7.mp3
	│   Untitled_8.mp3
	│   Untitled_9.mp3
	│
	└───shovel
	        tasks.py

My python script is incomplete but can be run by shovel using `shovel tasks.extractSongInfo "log file name.log"` from the directory above the 'shovel' directory. Here's the script:


	from shovel import task
	
	@task
	def extractSongInfo(logFile):
	    """Given a log file with lines like
	"{date}	INFO	 Currently playing - Song: {songName} - Artist: {artist} - Length: {numSeconds}"
	return a collection of extracted info."""
	    opId = "Extracting song info" # operation ID
	    print opId
	    print 'Done: ' + opId</p> ]]></description>
<pubDate>Sun, 22 Jul 2012 07:44:22 GMT</pubDate>
<guid>http://snipplr.com/view/66267/getting-shovel-to-work-in-windows-so-python-methods-can-be-run-like-individual-executables/</guid>
</item>
<item>
<title>(DOS Batch) Put windows to sleep (and keep it asleep!) - Rectifier</title>
<link>http://snipplr.com/view/65888/put-windows-to-sleep-and-keep-it-asleep/</link>
<description><![CDATA[ <p>This is a fraction of a much larger script which does multiple tasks. This scriptlet is intended to be interactive and somewhat user-friendly. First, it asks if you want to place the computer into sleep mode, then it kills pesky processes associated with interrupting sleep mode, finally, if you want the batch to skip waiting you can press Y to immediately start the sleep sequence or press N to cancel at the last second.</p> ]]></description>
<pubDate>Sun, 01 Jul 2012 06:24:51 GMT</pubDate>
<guid>http://snipplr.com/view/65888/put-windows-to-sleep-and-keep-it-asleep/</guid>
</item>
<item>
<title>(DOS Batch) Save (and clear) Windows Event Logs - Rectifier</title>
<link>http://snipplr.com/view/65885/save-and-clear-windows-event-logs/</link>
<description><![CDATA[ <p>Uses the sysinternals (microsoft) utility PsLogList to save specified event logs to files and then clears them. Method can be used to save logs as .evt and .evtx. This script has four event logs listed as an example and has a template command commented. Tested on a local windows 7 machine, but should work for xp, server 2k3 and 2k8.</p> ]]></description>
<pubDate>Sun, 01 Jul 2012 03:54:14 GMT</pubDate>
<guid>http://snipplr.com/view/65885/save-and-clear-windows-event-logs/</guid>
</item>
<item>
<title>(DOS Batch) Clear Windows 7 Event Log - Rectifier</title>
<link>http://snipplr.com/view/65884/clear-windows-7-event-log/</link>
<description><![CDATA[ <p>This is a simple batch script to clear the event logs from a windows 7 or server 2008 machine. The script does *not* save these logs. This was tested on a local machine but could be adapted for remote use.</p> ]]></description>
<pubDate>Sun, 01 Jul 2012 03:42:51 GMT</pubDate>
<guid>http://snipplr.com/view/65884/clear-windows-7-event-log/</guid>
</item>
<item>
<title>(PHP) Drupal Batch API for hook_update_N() - wizonesolutions</title>
<link>http://snipplr.com/view/62213/drupal-batch-api-for-hookupdaten/</link>
<description><![CDATA[ <p>This is the Batch API example shown on http://api.drupal.org/api/drupal/developer--hooks--install.php/function/hook_update_N/6.</p> ]]></description>
<pubDate>Sun, 01 Jan 2012 15:44:56 GMT</pubDate>
<guid>http://snipplr.com/view/62213/drupal-batch-api-for-hookupdaten/</guid>
</item>
<item>
<title>(DOS Batch) Import svn repository dump - altern</title>
<link>http://snipplr.com/view/62093/import-svn-repository-dump/</link>
<description><![CDATA[ <p>script imports svn dump into the repository</p> ]]></description>
<pubDate>Thu, 22 Dec 2011 22:22:25 GMT</pubDate>
<guid>http://snipplr.com/view/62093/import-svn-repository-dump/</guid>
</item>
<item>
<title>(DOS Batch) Create svn repository dump - altern</title>
<link>http://snipplr.com/view/62092/create-svn-repository-dump/</link>
<description><![CDATA[ <p>Batch script creates repository dump of specific project in repository. It assumes that repository has following structure:

    /project1
        /trunk
        /tags
        /branches

    /project2
        /trunk
        /tags
        /branches
    ...
    /projectN
        /trunk
        /tags
        /branches

Needs UnxUtils installed to be executed successfully(http://unxutils.sourceforge.net/)</p> ]]></description>
<pubDate>Thu, 22 Dec 2011 22:04:54 GMT</pubDate>
<guid>http://snipplr.com/view/62092/create-svn-repository-dump/</guid>
</item>
<item>
<title>(DOS Batch) Create initial svn repository structure - altern</title>
<link>http://snipplr.com/view/62091/create-initial-svn-repository-structure/</link>
<description><![CDATA[ <p>Batch script creates initial svn repository structure according to SCM framework (http://scm.altern.kiev.ua):
    /project
        /trunk
        /tags
            /builds
                /PA
                /A
                /B
            /releases
                /AR
                /BR
                /RC
                /ST
        /branches
            /support
            /releases
            /experimental
            /feature</p> ]]></description>
<pubDate>Thu, 22 Dec 2011 21:53:48 GMT</pubDate>
<guid>http://snipplr.com/view/62091/create-initial-svn-repository-structure/</guid>
</item>
<item>
<title>(DOS Batch) svn add recursively on windows - altern</title>
<link>http://snipplr.com/view/62067/svn-add-recursively-on-windows/</link>
<description><![CDATA[ <p>'svn add' all unversioned files in a working copy to svn repository recursively on windows</p> ]]></description>
<pubDate>Thu, 22 Dec 2011 01:56:28 GMT</pubDate>
<guid>http://snipplr.com/view/62067/svn-add-recursively-on-windows/</guid>
</item>
<item>
<title>(Bash) Batch move small files to separate directory - graceman9</title>
<link>http://snipplr.com/view/61354/batch-move-small-files-to-separate-directory/</link>
<description><![CDATA[ <p>Separate small and big files by moving it out to different directories.</p> ]]></description>
<pubDate>Thu, 01 Dec 2011 00:01:29 GMT</pubDate>
<guid>http://snipplr.com/view/61354/batch-move-small-files-to-separate-directory/</guid>
</item>
<item>
<title>(DOS Batch) Putty SSH Auto-Login, Run Command File - vagrantradio</title>
<link>http://snipplr.com/view/59421/putty-ssh-autologin-run-command-file/</link>
<description><![CDATA[ <p>Script I use to tail my server log files.</p> ]]></description>
<pubDate>Wed, 05 Oct 2011 05:53:57 GMT</pubDate>
<guid>http://snipplr.com/view/59421/putty-ssh-autologin-run-command-file/</guid>
</item>
<item>
<title>(Bash) Apple Compressor Command Line Batch Submission - sq1labs</title>
<link>http://snipplr.com/view/57782/apple-compressor-command-line-batch-submission/</link>
<description><![CDATA[ <p>cd into sourcepath directory and then run command. destpath must have same tree structure as sourcepath
 
Crawls a directory and submits all .mov files encountered to Compressor command line, needs same tree structure at destination (Compressor 4) - example is prores hq setting</p> ]]></description>
<pubDate>Fri, 12 Aug 2011 12:43:24 GMT</pubDate>
<guid>http://snipplr.com/view/57782/apple-compressor-command-line-batch-submission/</guid>
</item>
<item>
<title>(Bash) Skeleton Directory Tree sync - sq1labs</title>
<link>http://snipplr.com/view/57781/skeleton-directory-tree-sync/</link>
<description><![CDATA[ <p>mirrors a tree without files on local file system</p> ]]></description>
<pubDate>Fri, 12 Aug 2011 12:35:54 GMT</pubDate>
<guid>http://snipplr.com/view/57781/skeleton-directory-tree-sync/</guid>
</item>
<item>
<title>(Python) Batch Download Sequence data from NCBI using EUtils - itskkumaran</title>
<link>http://snipplr.com/view/57580/batch-download-sequence-data-from-ncbi-using-eutils/</link>
<description><![CDATA[ <p>Based on http://www.ncbi.nlm.nih.gov/books/NBK25498/#chapter3.Application_3_Retrieving_large</p> ]]></description>
<pubDate>Wed, 03 Aug 2011 21:32:42 GMT</pubDate>
<guid>http://snipplr.com/view/57580/batch-download-sequence-data-from-ncbi-using-eutils/</guid>
</item>
<item>
<title>(Other) Vim - Escape % in a Batch script on current line - jasonseney</title>
<link>http://snipplr.com/view/55603/vim--escape--in-a-batch-script-on-current-line/</link>
<description><![CDATA[ <p>Does a search and replace to make all % on the line %% (ignores any %'s already escaped)</p> ]]></description>
<pubDate>Thu, 23 Jun 2011 01:47:07 GMT</pubDate>
<guid>http://snipplr.com/view/55603/vim--escape--in-a-batch-script-on-current-line/</guid>
</item>
</channel>
</rss>