ich soll den inhalt der dateien mergen. Sagen wir mal, die erste Datei beinhaltet 3 Zeilen:
zeile eins
zeile zwei
zeile drei
Die zweite Datei beinhaltet 2 Zeilen:
zeile vier
zeile fünf
Am Ende soll eine ganz NEUE Datei rauskommen, die dies beinhaltet:
zeile eins
zeile zwei
zeile drei
zeile vier
zeile fünf
Ich bin dankbar für jede Hilfestellung.
Ich habe nebenbei noch eine Frage bzgl. Textdatei. Ich habe folgendes gefunden:
The key difference between text files and binary files is that text files are composed of octets, or bytes, of binary data whereby each byte represents a character and the end of the file is marked by a special byte pattern, known generically as end of file, or eof. A binary file contains arbitrary binary data and thus no specific value can be used to identify end of file, thus a different mode of operation is required to read these files. The end result of this is that when we open a binary file in Python (or indeed any other language) we must specify that it is being opened in binary mode or risk the data being read being truncated at the first eof character that Python finds in the data. The way we do this in Python is to add a 'b' to the mode parameter.
Nun, zur Sicherung dass ich das richtig verstanden habe, mache ich mal ein Beispiel:
Ist das also so, dass eine Textdatei:
text
01001010 10100010 01010000 01110101 00001010 00001011
t e x t \ n
Ist das richtig so?
Ich bin mir nämlich nicht sicher.
Gruss, Ratna