Difference between revisions of "UNIX2MAC/de"

From Free Pascal wiki
Jump to navigationJump to search
(Created page with "{{UNIX2MAC}} <br> <br> Das Unterprogramm konvertiert die Zeilenumbrüche einer ASCII- bzw. ANSI-Textdatei vom UNIX-Format in das MAC-Format.<br> <syntaxhighlight> uses FileU...")
 
m (Fixed syntax highlighting; deleted category included in page template)
 
(2 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
{{UNIX2MAC}}
 
{{UNIX2MAC}}
<br>
+
 
<br>
+
 
 +
Zurück zur Seite [[Newline/de|Zeilenumbruch / Newline]].
 +
 
 +
 
 
Das Unterprogramm konvertiert die Zeilenumbrüche einer ASCII- bzw. ANSI-Textdatei vom UNIX-Format in das MAC-Format.<br>
 
Das Unterprogramm konvertiert die Zeilenumbrüche einer ASCII- bzw. ANSI-Textdatei vom UNIX-Format in das MAC-Format.<br>
<syntaxhighlight>
+
 
 +
<syntaxhighlight lang=pascal>
 
uses
 
uses
 
   FileUtil, ...;
 
   FileUtil, ...;
Line 42: Line 46:
 
end;
 
end;
 
</syntaxhighlight>
 
</syntaxhighlight>
<br>
+
 
 
Aufruf unter DOS, Windows:
 
Aufruf unter DOS, Windows:
<syntaxhighlight>
+
 
 +
<syntaxhighlight lang=pascal>
 
   subUNIX2MAC('E:\Test_alt.txt', 'E:\Test_neu.txt');
 
   subUNIX2MAC('E:\Test_alt.txt', 'E:\Test_neu.txt');
 
</syntaxhighlight>
 
</syntaxhighlight>
<br>
+
 
Aufruf unter LINUX:
+
Aufruf unter Linux:
<syntaxhighlight>
+
 
 +
<syntaxhighlight lang=pascal>
 
   subUNIX2MAC('/home/user/Test_alt.txt', '/home/user/Test_neu.txt');
 
   subUNIX2MAC('/home/user/Test_alt.txt', '/home/user/Test_neu.txt');
 
</syntaxhighlight>
 
</syntaxhighlight>
<br>
 
<br>
 
--[[User:Olaf|Olaf]] 08:19, 25 August 2013 (CEST)
 
[[Category:Code Parts/de]]{{AutoCategory}}
 

Latest revision as of 13:00, 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 MAC-Format.

uses
  FileUtil, ...;

  ...

procedure subUNIX2MAC(const conStrQuellDateiname, conStrZielDateiname: string);
// konvertiert Zeilenumbrüche von Unix, Linux, Android, Mac OS X, AmigaOS, BSD, usw. ... nach
// Mac OS (bis Version 9), Apple II und C64
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
      Write(txtZieldatei, #13)
    else
      Write(txtZieldatei, chrZeichen);

  end;

  closefile(txtQuelldatei);
  closefile(txtZieldatei);

end;

Aufruf unter DOS, Windows:

  subUNIX2MAC('E:\Test_alt.txt', 'E:\Test_neu.txt');

Aufruf unter Linux:

  subUNIX2MAC('/home/user/Test_alt.txt', '/home/user/Test_neu.txt');