Difference between revisions of "UNIX2DOS/de"
From Lazarus wiki
Jump to navigationJump to searchm (Fixed syntax highlighting; deleted category included in page template) |
|||
Line 1: | Line 1: | ||
{{UNIX2DOS}} | {{UNIX2DOS}} | ||
− | + | ||
− | + | ||
− | Zurück zur Seite [[Newline/de|Zeilenumbruch / Newline]]. | + | Zurück zur Seite [[Newline/de|Zeilenumbruch / Newline]]. |
− | + | ||
− | Das Unterprogramm konvertiert die Zeilenumbrüche einer ASCII- bzw. ANSI-Textdatei vom UNIX-Format in das DOS-Format. | + | |
− | <syntaxhighlight> | + | Das Unterprogramm konvertiert die Zeilenumbrüche einer ASCII- bzw. ANSI-Textdatei vom UNIX-Format in das DOS-Format. |
+ | |||
+ | <syntaxhighlight lang=pascal> | ||
uses | uses | ||
FileUtil, ...; | FileUtil, ...; | ||
Line 48: | Line 50: | ||
end; | end; | ||
</syntaxhighlight> | </syntaxhighlight> | ||
− | + | ||
Aufruf unter DOS, Windows: | Aufruf unter DOS, Windows: | ||
− | <syntaxhighlight> | + | |
+ | <syntaxhighlight lang=pascal> | ||
subUnix2Dos('E:\Test_alt.txt', 'E:\Test_neu.txt'); | subUnix2Dos('E:\Test_alt.txt', 'E:\Test_neu.txt'); | ||
</syntaxhighlight> | </syntaxhighlight> | ||
− | + | ||
Aufruf unter Linux : | Aufruf unter Linux : | ||
− | <syntaxhighlight> | + | |
+ | <syntaxhighlight lang=pascal> | ||
subUnix2Dos('/home/user/Test_alt.txt', '/home/user/Test_neu.txt'); | subUnix2Dos('/home/user/Test_alt.txt', '/home/user/Test_neu.txt'); | ||
</syntaxhighlight> | </syntaxhighlight> | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− |
Latest revision as of 13:01, 3 March 2020
│
Deutsch (de) │
Zurück zur Seite Zeilenumbruch / Newline.
Das Unterprogramm konvertiert die Zeilenumbrüche einer ASCII- bzw. ANSI-Textdatei vom UNIX-Format in das DOS-Format.
uses
FileUtil, ...;
...
procedure subUnix2Dos(const conStrQuellDateiname, conStrZielDateiname: string);
// konvertiert Zeilenumbrüche von Unix, Linux, Android, Mac OS X, AmigaOS, BSD usw. nach
// Windows, DOS, OS/2, CP/M oder TOS (Atari)
var
txtQuelldatei: file of char;
txtZieldatei: file of char;
chrZeichen: char;
begin
assignfile(txtQuelldatei, UTF8ToSys(conStrQuellDateiname));
assignfile(txtZieldatei, UTF8ToSys(conStrZielDateiname));
Rewrite(txtZieldatei);
Reset(txtQuelldatei);
Reset(txtZieldatei);
while not EOF(txtQuelldatei) do
begin
Read(txtQuelldatei, chrZeichen);
if (chrZeichen = #10) then
begin
Write(txtZieldatei, #13);
Write(txtZieldatei, chrZeichen);
Continue;
end;
Write(txtZieldatei, chrZeichen);
end;
closefile(txtQuelldatei);
closefile(txtZieldatei);
end;
Aufruf unter DOS, Windows:
subUnix2Dos('E:\Test_alt.txt', 'E:\Test_neu.txt');
Aufruf unter Linux :
subUnix2Dos('/home/user/Test_alt.txt', '/home/user/Test_neu.txt');