No installation. USB stick portable applications.
Swiss File Knife

a command line
multi function tool.

remove tabs
list dir sizes
find text
filter lines
find in path
collect text
instant ftp or
http server
file transfer
send text
patch text
patch binary
run own cmd
convert crlf
dup file find
md5 lists
fromto clip
hexdump
split files
list latest
compare dirs
save typing
trace http
echo colors
head & tail
find classes
dep. listing
speed shell
zip search
zip dir list

Depeche View
Source Research
First Steps

using vm linux

windows GUI
automation

the d3caster
java game engine

command line
file encryption

free external tools,
zero install effort,
usb stick compliant:

zip and unzip
diff and merge
reformat xml
reformat source

java sources

thread creation

cpp sources

log tracing
mem tracing
hexdump
using printf

articles

embedded
stat. c array
stat. java array
var. c array
var. java array
view all text
as you type
surf over text
find by click
quick copy
multi view
find nearby
fullscreen
bookmarks
find by path
expressions
location jump
skip accents
clip match
filter lines
edit text
highlight
load filter
hotkey list
receive text
send in C++
send in Java
smooth scroll
touch scroll
fly wxWidgets
fly over Qt
search Java

 
Bookmark on del.icio.us Bookmark on Google Add to Mr. Wong
Bookmark on digg.com Add to StumbleUpon Bookmark on Yahoo

 

Get instant Hello World example scripts, batch files and source code


for the Windows CMD.EXE shell, Linux bash, HTML code, or a simple Java/C++/PHP program as a starting point for your own editing, with the free sfk samp command for Windows, Mac OS X and Linux.
- download the free Swiss File Knife Base from Sourceforge.
- open the Windows CMD command line, Mac OS X Terminal or Linux shell.
- OS X : type mv sfk-mac-i686.exe sfk and chmod +x sfk then ./sfk
- Linux: type mv sfk-linux.exe sfk    and chmod +x sfk then ./sfk
  OS X and Linux syntax may differ, check the help within the tool.
SFK The Book - A Good Bedtime Reading.
sfk sample java|cpp|... [outfile.java|.cpp|...]

print a short example code in a programming language.

supported parameters
   sfk          create a simple sfk script
   sfkbat       sfk script embedded in a .bat or .cmd
   sfkbash      sfk script embedded in a bash script
   http         automated http access example script
   http -bat    ... as a windows .bat file
   http -bash   ... as a linux .sh file
   httpdata     create a .zip file with webdemo files
                for local use with sfk httpserv

   cmd          create generic windows .cmd or .bat file
   bash         create generic linux bash script
   html         simple html page with css and javascript
   java         create a java class doing text  file I/O
   javaimg      create a java class doing image file I/O
   javahex      create a hexdump of binary data in java
   javagui      create a simple java gui application
   cpp          create a c++ text file I/O example
   cppnetlog    how to send UDP network text in C++
   javanetlog   how to send UDP network text in Java
   php          create command line php code for text I/O
   phpimg       create php example for image processing

options
   -force    if output file exists already, overwrite it.

command shortcut
   sfk batch myscript.bat
      does the same as "sfk samp sfkbat myscript.bat"

web reference
   http://stahlworks.com/sfk-sample

more in the SFK Book
   the SFK Book contains a 60 page tutorial, including
   long sfk script examples with input, output and
   detail explanations. type "sfk book" for more.

examples
   sfk samp sfkbat foo.bat
      creates batch file foo.bat with embedded sfk script.
      type "foo.bat" to run the created script. note that
      foo.bat must be created in a directory of your PATH,
      or in the current directory.

   sfk batch foo.bat -force
      the same as above, and overwrites an existing file.

   sfk batch foo.sh
      create a bash script file, with lf only line endings.
      can also be used under windows for mingw environments.

   sfk samp java foo.java
      create a java class foo. if the java JDK is available,
      type "javac foo.java" and then "java foo" to run it.

   sfk samp phpimg doimg.php
      create image processing script that can be run by:
      php doimg.php
      if php.exe is in your PATH (read remarks in the script).

   sfk samp javahex +toclip
      copy example for java hexdump creation to the clipboard.

   sfk samp http tmp.bat
      create an example script for automated web/http access.

   sfk samp http -bash tmp.sh
      the same, but using bash in a Windows Cygwin environment.
 

the samples produced are:

sfk samp sfk
sfk select testfiles .txt .hpp .cpp // find words supplied by user. // note that %1 is the same as $1. +find %1 %2 %3 $4 $5 $6 // process files containing hits +run -quiet "sfk echo \"Found hit in: [green]$file[def]\"" -yes // run the script by: // "sfk script thisfile pattern1 [pattern2 ...]"
sfk samp sfkbat
@echo off sfk script %~f0 -from begin %* rem . %~f0 is the absolute batch file name GOTO xend sfk label begin -var +if "%1 = " begin +tell "add 'play' to play the number game." +stop 0 +endif +if "%1 = play" begin +call game +stop 0 +endif +tell "unknown parameter: %1" +end sfk label game // Note: install SFKTray to see colorful lights. +rand 1 10 +setvar mynum +tell "i know a number, you can guess it." +tell "enter from 1 to 10, you have 3 tries." +setvar try="try again." +for i from 1 to 3 +prompt +setvar usernum +if "#(i) > 2" then setvar try="" +if "#(mynum) < #(usernum)" begin +status local "slot=#(i) color=red" +tell "no, my number is [Red]lower[def]. #(try)" +endif +if "#(mynum) > #(usernum)" begin +status local "slot=#(i) color=red" +tell "no, my number is [Red]higher[def]. #(try)" +endif +if "#(mynum) = #(usernum)" begin +status local "slot=1 color=green blink=fast timeout=10" +status local "slot=2 color=green blink=fast timeout=10" +tell "[green]correct, you win![def]" +stop 0 +endif +endfor +status local "slot=1 color=red blink=fast timeout=10" +status local "slot=2 color=red blink=fast timeout=10" +tell "[Red]3 tries done, you loose. it was #(mynum).[def]" +end :xend
sfk samp sfkbash
#!/bin/bash sfk script $0 -from begin $@ function skip_block { sfk label begin -var # +echo "main got parameters: %1 %2 %3" # +then setvar "a=the quick brown fox" # +call myfunc foo bar %1 # +end # // note that # lines are skipped by bash, # // but not by sfk. sfk label myfunc +echo "func got parameters: %1 %2 %3" +echo "variable a contains: #(a)" +echo "#(a)" +tcall substr 4 5 +setvar b +echo "variable b contains: #(b)" +end sfk label substr +xex "/[start][%1 chars][%2 chars]/[part3]/" +tend # // if bash produces errors with \r you must: # // sfk remcr thisfile.sh }
sfk samp http
@echo off sfk script %~f0 -from begin %* rem "%~f0" is the absolute batch file name. GOTO xend sfk label begin -var // the -var above enables variables everywhere. +setvar "baseurl=http://stahlworks.com/webdemo" +web "#(baseurl)/contents.xml" +xex "_<category>**<id>*</id>**<name>*< _[part4] [part8]\n_" +perline "call listCategory #text" -yes +end sfk label listCategory +echo "[green]=== List of %2: ===[def]" +echo -spat "[yellow]Name Price[def]" +then web "#(baseurl)/product_list_%1.xml" // +xmlform +stop -all +xex "=<row>**<name>*<**<price>*< =[part4]\t[part8] \x24\n=" +filter -upat -stabform "#(-12col1) #col2" +end rem a longer example with input, output and detail rem explanations is available in the SFK Book. :xend
sfk samp java
import java.io.*; public class fileio { static void log(String s) { System.out.println("main: "+s); } public static void main(String args[]) throws Throwable { if (args.length < 2) { log("supply in- and output filename."); return; } // copy or convert text file BufferedReader rin = new BufferedReader( new InputStreamReader( new FileInputStream(args[0]), "ISO-8859-1" // or US-ASCII,UTF-8,UTF-16BE,UTF-16LE,UTF-16 )); PrintWriter pout = new PrintWriter( new OutputStreamWriter( new FileOutputStream(args[1]), "ISO-8859-1" )); while (true) { String sline = rin.readLine(); if (sline == null) break; // EOD log("copying line: "+sline); pout.println(sline); } pout.close(); rin.close(); } };
sfk samp cpp
#include <stdio.h> #include <string.h> #include <stdarg.h> #include <stdlib.h> #include <ctype.h> // print error message with variable parameters. int perr(const char *pszFormat, ...) { va_list argList; va_start(argList, pszFormat); char szBuf[1024]; ::vsprintf(szBuf, pszFormat, argList); fprintf(stderr, "error: %s", szBuf); return 0; } // copy text lines from one file into another. int main(int argc, char *argv[]) { if (argc < 2) return 9+perr("specify input and output filename.\n"); char *pszInFile = argv[1]; char *pszOutFile = argv[2]; FILE *fin = fopen(pszInFile , "rb"); if (!fin ) return 9+perr("cannot read %s\n" , pszInFile); FILE *fout = fopen(pszOutFile, "wb"); if (!fout) return 9+perr("cannot write %s\n", pszOutFile); char szBuf[1024]; memset(szBuf, 0, sizeof(szBuf)); while (fgets(szBuf, sizeof(szBuf)-10, fin)) { char *psz = strchr(szBuf, '\r'); if (psz) *psz = '\0'; // strip cr psz = strchr(szBuf, '\n'); if (psz) *psz = '\0'; // strip lf printf("line: \"%s\"\n", szBuf); strcat(szBuf, "\n"); int nlen = strlen(szBuf); if (fwrite(szBuf, 1, nlen, fout) != nlen) return 9+perr("failed to fully write %s\n", pszOutFile); } fclose(fout); fclose(fin); return 0; }
sfk samp cmd
@rem windows command shell batch example @echo off IF "%1"=="" GOTO xerr01 echo "parameter is %1" GOTO xdone :xerr01 echo "please supply a parameter." echo "example: mybat parm123" GOTO xdone :xdone
sfk samp bash
#!/bin/bash function pmsg { # uses a local variable mystr local mystr="info: $1" echo $mystr } myparm1="$1 and $2" # no blanks around "=" if [ "$2" = "" ]; then # requires all blanks pmsg "please supply two parameters." else pmsg "you supplied \"$myparm1\"." # < -lt > -gt <= -le >= -ge == -eq != -ne i=1 while [ $i -le 5 ]; do # not "$i < 5" echo counting: $i # quotes are optional let i+=1 # not "i += 1" or "$i+=1" done fi

 
sfk is a free open-source tool, running instantly without installation efforts. no DLL's,
no registry changes - just get sfk.exe from the zip package and use it (binaries for
windows, linux and mac are included).

read more about all sfk functions here.

Download the free Depeche View Lite Text Search Tool