Download - PA053879

BSEK (Backup/copy Software Evaluation Kit)の詳細情報 : Vector ソフトを探す!

-> [Go to the download page] -> [Download Now]

The Latest Snapshot - BSEK

@rem = ('--*-Perl-*--
@echo off
if exist %0.bat perl %0.bat %1 %2 %3 %4 %5 %6 %7 %8 %9
if not exist %0.bat perl -S %0.bat %1 %2 %3 %4 %5 %6 %7 %8 %9
goto exit ') if 0;

#!/usr/local/bin/perl
#
# File Name: "t2hp.bat" - Text TO xHtml Parts BATch for perl
#
# Copyright: Public Domain Software (NOT TO BE SHAREWARE OR FREEWARE)
#
# Version (??: secondary series; can be revised by somebodies)
# *.*?? by ***	May be revised for something
#
# Version (ps: primary series; reserved for S. )
# 1.?ps by S.	Revised to support additional documents.
# 1.?ps by S.	Revised to generate XHTML documents.
# 1.0ps by S.	Created for perl4 or later version.
#
# Related Softwares (required):
#
# - perl 5, version 16, subversion 3 (v5.16.3) built for MSWin32-x64-multi-thread (freeware, 64bit)
#   http://www.activestate.com/activeperl/downloads
#   http://downloads.activestate.com/ActivePerl/releases/5.16.3.1603/ActivePerl-5.16.3.1603-MSWin32-x64-296746.msi
#   (used: "perl.exe" and "perl516.dll")

# sub: Smart Include
sub sinc {
	local($subin, *stab) = @_;
	local($key, $val, $eval = '');
	if (-s $subin) {
		if (%stab) {
			foreach $key (keys %stab) {
				$val = eval($stab{$key});
				if ($val ne '') {
					$key =~ s/([^\w\s])/\\$1/g;
					$val =~ s/([^\w\s])/\\$1/g;
					$eval .= "s/$key/$val/g;\n";
				}
			}
		}
		open(SUBIN, $subin) || die "Can't open \"$subin\": $!\a\n";
		while (<SUBIN>) {
			eval($eval);
			print;
		}
	}
}

# main: Setup
{
	if ($ARGV[0] =~ /^(-h|--help)$/) {
		print <<'EOD';
Usage:
 t2hp [-h|--help] [-omd:N] [-tab:N] [-phf:PHF] [-shf:SHF] [">OHF"] [ITF..]
-omd:0 Operation Mode for IE with Tabs to Spaces conversion
-omd:1 Operation Mode for IE/Firefox (default)
-omd:2 Operation Mode for IE/Opera
-tab:N Tab Size N (default:8, with -omd:0 operator)
PHF:   Prefix XHTML File
SHF:   Suffix XHTML File
OHF:   Output XHTML File
ITF:   Input Text Files

e.g. t2hp -omd:0 -tab:8 ">out.htm" in1.txt in2.txt
e.g. t2hp -omd:1 -phf:pre.htm -shf:suf.htm ">out.htm" in1.txt
EOD
		exit;
	}
	$omd = 1;	# default Operation Mode
	@ARGV = grep(/^-omd:?(.*)/ ? ($omd = $1, 0) : 1, @ARGV);
	$tab = 8;	# default Tab Size
	@ARGV = grep(/^-tab:(.+)/ ? ($tab = $1, 0) : 1, @ARGV);
	$phf = '';	# default Prefix XHTML File
	@ARGV = grep(/^-phf:?(.*)/ ? ($phf = $1, 0) : 1, @ARGV);
	$shf = '';	# default Suffix XHTML File
	@ARGV = grep(/^-shf:?(.*)/ ? ($shf = $1, 0) : 1, @ARGV);
	$outfile = '>-';	# default: STDOUT
	@ARGV = grep(/^>/ ? ($outfile = $_, 0) : 1, @ARGV);
	open(STDOUT, $outfile) || die "Can't open \"$outfile\": $!\a\n";
	$ohf = $outfile eq '>-' ? 'STDOUT' : $outfile;
	$ohf =~ s/^>\s*(.*[\/\\:])?//;	# Output XHTML File name
	$oht = 'No Title';		# default Output XHTML Title name
	$stab{'{$t2hp.filename}'} = '$ohf';	# Substitute Table
	$stab{'{$t2hp.title}'} = '$oht';	# Substitute Table
}

# main: Main Routine
{
	$apmk = '>'.'__A_P_P_E_N_D__'.'>';	# Append Mark
	$oseq = 0;	# Output Sequence
	$obuf = '';	# Output Buffer
	$lcnt = 10;	# Line Count
	$id = '';	# Link ID
	$cont = '';	# Contents List
	$stat = 0;	# Prefix Status
	$pref = "\n";	# Prefix String
	$n = '';	# New Line Control
	if ($omd > 1) {
		$n = "\n";
		print '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">', "\n";
	}
	while (($_ = <ARGV>) ne '') {
#		$obuf .= '<!-- start of XHTML parts --><div class="pds" style="border:solid 1px;padding:0 0.5em;font-family:monospace">' if $. == 1;
;;		$obuf .= '<!-- start of XHTML parts --><div class="pds" style="border:solid 0px;padding:0 0.5em;font-family:monospace">' if $. == 1;
#		next if /^!/;	# Comment Line
		s/&/&amp;/g;
		s/</&lt;/g;
		s/>/&gt;/g;
		1 while !$omd && s/\t+/' ' x (length($&) * $tab - length($`) % $tab)/e;	# Tabs to Spaces
		$oseq++ if $oseq == 0 && (/^([:#]*\s*Subject:|[:#]+\s*File Name:|help ")\s*(.*)/ && ($oht = $2) || $. >= $lcnt || eof());
		s!\[img\]([^[]*)\[/img\]!<a href="$1" target="_blank"><img src="$1" alt="&#x5b;img&#x5d;$1&#x5b;/img&#x5d;" /></a>!g;
		s/&gt;&gt;/$apmk/g;
		s!\b((https?|ftp)://[^\s"'>]+)!<a href="$1" target="_blank">$1</a>!g;
		s/$apmk/&gt;&gt;/g;
		s!(\w[\w.-]*@\w[\w.-]*\.\w+)!<a href="mailto:$1">$1</a>!g;
		if (/^\$\s*([\d.]*\d)/) {
			$id = $1;
			$id =~ s/\./_/g;
			chop;
			s/  / &nbsp;/g;
			$cont .= "\n<h3><a href=\"#sect$id\" id=\"cont$id\" name=\"cont$id\">$_</a></h3>";
			$pref = $omd && $stat ? "$n</pre>" : "\n";
			$_ = "$pref<h3><a href=\"#cont$id\" id=\"sect$id\" name=\"sect$id\">$_</a></h3>";
			$stat = 0;
		} elsif (/^(Subject|Title):/) {
			chop;
			s/  / &nbsp;/g;
			$pref = $omd && $stat ? "$n</pre>" : "\n";
			$_ = "$pref<h2>$_</h2>";
			$stat = 0;
		} else {
			chop;
			if (!$omd) {
				s/  / &nbsp;/g;
				s/^ /&nbsp;/;
			}
			$pref = '';
			$pref = '<pre>' if $omd && !$stat;
			$pref = '<br />' if !$omd && $stat;
			$_ = "$pref\n$_";
			$stat = 1;
		}
		if ($oseq == 0) {
			$obuf .= $_;
		} elsif ($oseq == 1) {
			$obuf .= $_;
			&sinc($phf, *stab);
			print $obuf;
			$obuf = '';
			$oseq++;
		} else {
			print;
		}
		if (eof()) {
			if (!$stat) {
				print "\n";
			} elsif ($omd) {
				print "\n</pre>\n";
			} elsif (!$cont) {
				print "<br />\n";
			}
			print '<h2>Contents</h2>', $cont, "\n" if $cont;
			print <<'EOD';
</div><div style="font-size:90%">
/* Copyright: Public Domain (free contents) for the contents in the just above element. */<br />
/* Everyone can copy, revise and distribute/publish the contents in the just above element. */<br />
/* Everyone can copy, paste, save and use the contents in the just above element. */<br />
</div><!-- end of XHTML parts -->
EOD
		}
	}
	&sinc($phf, *stab) if $oseq == 0;
	&sinc($shf, *stab);
}

@rem = ('
:exit ') if 0;
/* Copyright: Public Domain (free contents) for the contents in the just above element. */
/* Everyone can copy, revise and distribute/publish the contents in the just above element. */
/* Everyone can copy, paste, save and use the contents in the just above element. */

Links - PA053879

Top Page - PA053879

BSEK (Backup/copy Software Evaluation Kit)

Windows システムをファイルコピー型バックアップする検討内容

"xcpt.bat" - eXtended CoPy Test BATch for Windows7 HP 64bit(x64)

"xcp.bat" - eXtended CoPy BATch for Windows7 HP 64bit(x64)

"xat.bat" - eXtended ATtrib BATch for Windows7 HP 64bit(x64)

"bcde.bat" - Boot Configuration Data Edit BATch for Windows 7 (OEM_SLP) / PE3.x - BCD Builder/Generator

"t2hp.bat" - Text TO xHtml Parts BATch for perl

"dddi.bat" - Device class Drivers DisInstaller / Inactive-Installer BATch for Windows 7 (OEM_SLP) / PE3.x

"bpbf.bat" - "BPB" display tool text Filtering wrapper

The making of the integrated ISO file / bootable CD/DVD/BD

The making of 2048[sct] aligned / 2^n[GB] normalized partitions

Ideal 2TB HDD, 256GB partitions, Optimal alignment

Ideal 2TB HDD, 256GB partitions, with gaps for Cyl. boundary

Ideal 2TB HDD, 128GB partitions, Optimal alignment

Ideal 2TB HDD, 128GB partitions, with gaps for Cyl. boundary

Ideal 2TB HDD, 64GB partitions, Optimal alignment

Ideal 2TB HDD, 64GB partitions, with gaps for Cyl. boundary

I-O DATA HDPC-UT, 64GB partitions, with gaps for Cyl. boundary

Hitachi HTS545050B9A300, 64GB partitions, with gaps for Cyl. boundary

FUJITSU MHT2030AT, 8GB partitions, with gaps for Cyl. boundary

Ideal USB Memory, single partition, Optimal alignment

The making of USB bootable system for Windows 7 (OEM_SLP) / PE3.x

counter