HOME > > sed с鴻鴻鴻

sed с鴻鴻鴻

鐚絎SedWord 莢ф後ラэ

ュ幻鴻膂≦医激顔≪腱医с a2ps фユ茯篏帥mpage 潟泣ゃ冴茵絎с篏с≪c宴筝紫奨с篏帥sed с鴻鴻<ゃ篏с違医т戎膂>梢筝綽荀綽拷絎号сс

sed -nf text2ps.sed plain.txt > plain.ps

c篏帥 sed 鴻吾帥鐚sed -n 激с潟莎桁鐚

text2ps.sed

茵菴cсpr nkf -f 激с潟筝茵絖違 sed 鴻с綏ャ潟若c潟違激鴻 utf-8 篏睡

荐絎<ゃ<<сsed 鴻c帥ф吾茯炊眼潟潟泣ゃ冴茵1 若吾茵違若若泣ゃ冴綏割若吾潟荐絎с

鴻筝祉茯<≪

#!/bin/sed -nf
# usage:    sed -nf text2ps.sed text.txt > text.ps
1 {
h
s/.*/1/
x
}

鴻筝絎茵若鴻若鴻 1 篆絖сゃ潟<潟 Postscript DSC 潟<潟筝若悟垩篏睡 DSC 若悟垩evince gv с若吾緇祉茵腓冴с

1 i\

障篁ヤ鴻阪i 潟潟\ ч壕障с阪

%!PS-Adobe-3.0\
%%BoundingBox: 0 0 595 841            % <-- set paper width and height (A4) here and...\
%%EndComments\
%%BeginProlog\
/paperwidth  595 /paperheight 841 def def\ % <--- ... here again (A4 portrate)\
/fontsize 10 def                      % <--- set fontsize here\
/fontname /Ryumin-Light-UniJIS-UTF8-H def % <--- sef fontname here\
% /fontname /GothicBBB-Medium-UniJIS-UTF8-H def % <--- maybe you like this\
/spacing 5 def                        % <--- set line spacing here\
/leftmargin 80 def                    % <--- set left margin here\
/uppermargin 100 def                  % <--- set upper margin here\
/okuri fontsize spacing add def\
/unijis { fontname findfont fontsize scalefont } def\
/S {save gsave unijis setfont leftmargin paperheight uppermargin sub moveto} def\
/N {currentpoint okuri sub leftmargin exch moveto pop} def\
/E {grestore restore showpage} def\
%%EndProlog\
%%BeginSetup\
<</PageSize [paperwidth paperheight]>>\
%%EndSetup\
%%Page: 1 1\
S

若若泣ゃ冴篋膊ч茲絎筝ゃ Postscript у祉篏睡с筝ゃ DSC 潟<潟 Boundingbox 絎篏睡緇 gv evince с茵腓冴茵腓榊蚊障膓 S 若吾E 腟N 域紮篏帥絎臂潟 /Ryumin-Light-UniJIS-UTF8-H 篏睡

:a
$ b b
/\([^\n]*\n\)\{44\}/! {               # <--- substitute (lines_per_page - 1) for 44
N
b a
}
:b

1 若吾 45 茵ャ篏罐с莨若障壕 44 障с域茯粋昭с篁ュ帥若潟鴻若鴻 1 若吾吟鴻壕у阪綵≪уャc

s/^/(/

若後 "(" 水ャ筝茵鴻鐚 鐚 "("

s/\n/) show \
N(/g

若後ф壕絎茵") show" 茵"N (" 罨∴吾莨若N current point 綏腴腱糸膓сsed N 潟潟с

s/$/) show\
E\
/
p

若吾緇у茵") show" 水ャ膓 E 水ャ p 潟潟с帥若潟鴻若鴻1 若吾吟鴻鴻茵憗阪帥若潟鴻若鴻罨<若吾 DSC 潟<潟若悟垩篏篏帥

g
/\([0-9]*\)[0-8]$/ {
s/\([0-9]*\)8$/\19/
s/\([0-9]*\)7$/\18/
s/\([0-9]*\)6$/\17/
s/\([0-9]*\)5$/\16/
s/\([0-9]*\)4$/\15/
s/\([0-9]*\)3$/\14/
s/\([0-9]*\)2$/\13/
s/\([0-9]*\)1$/\12/
s/\([0-9]*\)0$/\11/
b e
}
/^99*$/ {
y/9/0/
s/^/1/
b e
}
h
s/\(.*[^9][^9]*\)99*$/\1/
s/\([0-9]*\)8$/\19/
s/\([0-9]*\)7$/\18/
s/\([0-9]*\)6$/\17/
s/\([0-9]*\)5$/\16/
s/\([0-9]*\)4$/\15/
s/\([0-9]*\)3$/\14/
s/\([0-9]*\)2$/\13/
s/\([0-9]*\)1$/\12/
x
s/.*[^9]\(99*\)$/\1/
y/9/0/
H
g
s/\n//
:e
h

若御違ゃ潟<潟障若鴻若鴻憜若悟垩綣冴ゃ潟<潟帥若潟鴻若鴻臀罨<ゃ潟<潟違医若鴻若鴻潟若ゃ潟<潟篁腟帥с

s/.*/%%Page: & &\
S\
/
$ q
p

若悟垩 DSC 潟<潟膓 S 水ャ罨<若吾紮膓 S 潟ゃ潟膣綏筝祉腱糸腟茵 $ с阪綽荀сq у喝祉鴻腟篋腟茵篁ュс p с阪sed 罨<泣ゃャ

罨≠
HOME


紕膣
薤藕

茯絖
沿
ユ茯


遵医