Rdb: Ruby-Nachbau der MWC /rdb-Werkzeuge

This commit is contained in:
wkh
2026-10-11 20:33:17 +02:00
commit a9990169e9
308 changed files with 16738 additions and 0 deletions
+99
View File
@@ -0,0 +1,99 @@
.TH tabletosed "" "" "/rdb Command"
.PC "Convert table format to sed file format"
\fBtabletosed < \fItable \fB> \fIsedfile\fR
.PP
.II sed
.II "table^convert to sed commands"
The command
.B tabletosed
converts a two-column
.I table
into a file of
.B sed
statements that can be input to the
.B sed
stream editor.
.B sed
macros are in the form:
.DM
s/old/new/g
.DE
.PP
.B sed
can do many things, including word-for-word substitution.
.I sedfile
produced is used by the
.B /rdb
command
.BR translate .
It can be used for language translation (in a stiff, inflexible way)
and for other conversions of data bases.
.SH Example
Suppose we have a simple translation table, called
.BR ed.t "
.DM
English Deutch
------- -------
I Ich
love liebe
you dich
widgit
.DE
.PP
The following command turns
.B ed.t
into a file of
.B sed
editing instructions, called
.BR ed.sed.1 :
.DM
tabletosed < ed.t > ed.sed.1
.DE
.PP
.B ed.sed.1
appears as follows:
.DM
s/I/Ich/g
s/love/liebe/g
s/you/dich/g
.DE
.PP
We can now use
.B ed.sed.1
with
.B sed
or
.BR translate .
For example, if file
.B text
contains the sentence
.DM
I love you.
.DE
.PP
then typing
.DM
sed -f ed.sed.1 text
.DE
.PP
prints the following on the standard output:
.DM
Ich liebe dich.
.DE
.PP
You can also use this command to construct form letters.
.SH "See Also"
.B
translate
.R
.br
COHERENT Tutorials:
.B
Introduction to the sed Stream Editor
.R
.br
COHERENT Lexicon:
.B
sed
.R
.SO tabletosed