Sign in Join
Wiki copytemporary

MAC2UNIX/de: what changed

Revision 1 to 2. Removed lines have a minus sign; added lines have a plus sign.

OldNewLine
1-\
2-\
31Zurück zur Seite [[Newline/de|Zeilenumbruch / Newline]].\
4-\
2+
53Das Unterprogramm konvertiert die Zeilenumbrüche einer ASCII- bzw. ANSI-Textdatei vom MAC-Format in das UNIX-Format.\
64
75``` pascal
86uses
97 FileUtil, ...;
108
119 ...
1210
1311procedure subMAC2UNIX(const conStrQuellDateiname, conStrZielDateiname: string);
1412// konvertiert Zeilenumbrüche von Mac OS (bis Version 9), Apple II und C64 nach
1513// Unix, Linux, Android, Mac OS X, AmigaOS, BSD, usw ...
1614var
1715 txtQuelldatei: file of char;
1816 txtZieldatei: file of char;
1917 chrZeichen: char;
2018
2119begin
2220
2321 assignfile(txtQuelldatei, UTF8ToSys(conStrQuellDateiname));
2422 assignfile(txtZieldatei, UTF8ToSys(conStrZielDateiname));
2523 Rewrite(txtZieldatei);
2624 Reset(txtQuelldatei);
2725 Reset(txtZieldatei);
2826
2927 while not EOF(txtQuelldatei) do
3028 begin
3129
3230 Read(txtQuelldatei, chrZeichen);
3331
3432 if (chrZeichen = #13) then
3533 Write(txtZieldatei, #10)
3634 else
3735 Write(txtZieldatei, chrZeichen);
3836
3937 end;
4038
4139 closefile(txtQuelldatei);
4240 closefile(txtZieldatei);
4341
4442end;
4543```
4644
47-\
4845Aufruf unter DOS, Windows:
4946
5047``` pascal
5148 subMAC2UNIX('E:\Test_alt.txt', 'E:\Test_neu.txt');
5249```
5350
54-\
5551Aufruf unter LINUX:
5652
5753``` pascal
5854 subMAC2UNIX('/home/user/Test_alt.txt', '/home/user/Test_neu.txt');
5955```
6056
6157---
6258*From the Free Pascal wiki, page "MAC2UNIX/de", as it stood on 2020-02-19 after a change by Trev, out of the wiki's dump of 2024-05-26. Copyright stays with the author who wrote it, according to the old wiki's [[Licensing]] page. If you have concerns about this material, [message the admin](/wiki-contact).*

Back to history