MAC2UNIX/de: what changed
Revision 1 to 2. Removed lines have a minus sign; added lines have a plus sign.
| Old | New | Line | |
|---|---|---|---|
| 1 | - | ||
| 2 | - | ||
| 3 | 1 | Zurück zur Seite [[Newline/de|Zeilenumbruch / Newline]].\ | |
| 4 | - | ||
| 2 | + | ||
| 5 | 3 | Das Unterprogramm konvertiert die Zeilenumbrüche einer ASCII- bzw. ANSI-Textdatei vom MAC-Format in das UNIX-Format.\ | |
| 6 | 4 | ||
| 7 | 5 | ``` pascal | |
| 8 | 6 | uses | |
| 9 | 7 | FileUtil, ...; | |
| 10 | 8 | ||
| 11 | 9 | ... | |
| 12 | 10 | ||
| 13 | 11 | procedure subMAC2UNIX(const conStrQuellDateiname, conStrZielDateiname: string); | |
| 14 | 12 | // konvertiert Zeilenumbrüche von Mac OS (bis Version 9), Apple II und C64 nach | |
| 15 | 13 | // Unix, Linux, Android, Mac OS X, AmigaOS, BSD, usw ... | |
| 16 | 14 | var | |
| 17 | 15 | txtQuelldatei: file of char; | |
| 18 | 16 | txtZieldatei: file of char; | |
| 19 | 17 | chrZeichen: char; | |
| 20 | 18 | ||
| 21 | 19 | begin | |
| 22 | 20 | ||
| 23 | 21 | assignfile(txtQuelldatei, UTF8ToSys(conStrQuellDateiname)); | |
| 24 | 22 | assignfile(txtZieldatei, UTF8ToSys(conStrZielDateiname)); | |
| 25 | 23 | Rewrite(txtZieldatei); | |
| 26 | 24 | Reset(txtQuelldatei); | |
| 27 | 25 | Reset(txtZieldatei); | |
| 28 | 26 | ||
| 29 | 27 | while not EOF(txtQuelldatei) do | |
| 30 | 28 | begin | |
| 31 | 29 | ||
| 32 | 30 | Read(txtQuelldatei, chrZeichen); | |
| 33 | 31 | ||
| 34 | 32 | if (chrZeichen = #13) then | |
| 35 | 33 | Write(txtZieldatei, #10) | |
| 36 | 34 | else | |
| 37 | 35 | Write(txtZieldatei, chrZeichen); | |
| 38 | 36 | ||
| 39 | 37 | end; | |
| 40 | 38 | ||
| 41 | 39 | closefile(txtQuelldatei); | |
| 42 | 40 | closefile(txtZieldatei); | |
| 43 | 41 | ||
| 44 | 42 | end; | |
| 45 | 43 | ``` | |
| 46 | 44 | ||
| 47 | - | ||
| 48 | 45 | Aufruf unter DOS, Windows: | |
| 49 | 46 | ||
| 50 | 47 | ``` pascal | |
| 51 | 48 | subMAC2UNIX('E:\Test_alt.txt', 'E:\Test_neu.txt'); | |
| 52 | 49 | ``` | |
| 53 | 50 | ||
| 54 | - | ||
| 55 | 51 | Aufruf unter LINUX: | |
| 56 | 52 | ||
| 57 | 53 | ``` pascal | |
| 58 | 54 | subMAC2UNIX('/home/user/Test_alt.txt', '/home/user/Test_neu.txt'); | |
| 59 | 55 | ``` | |
| 60 | 56 | ||
| 61 | 57 | --- | |
| 62 | 58 | *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).* |
