Permalänk
Medlem

Slå samman rader

Hej,

Behöver lite hjälp att slå samman rader i en fil med en annan.

Ex. på hur det ser ut just nu.

Fil 1

msgctxt "#30000" msgid "Settings" msgstr "" msgctxt "#30001" msgid "Cancel" msgstr ""

Fil 2

tom rad tom rad msgstr "Inställningar" tom rad tom rad msgstr "Avbryt"

Ex. på hur jag vill att det ska se ut.

Resultat

msgctxt "#30000" msgid "Settings" msgstr "Inställningar" msgctxt "#30001" msgid "Cancel" msgstr "Avbryt"

Någon som har en ide för hur man kan återskapa detta, Powershell, Notepad++ eller Python?

Tacksam för all hjälp.

Visa signatur

AMD 7800X3D | ASUS TUF X670E-PLUS | Corsair Vengeance DDR5 32GB EXPO | ASUS TUF 4090 OC 24GB |
Noctua NH-U12A | Corsair 4000D | Corsair AX1200W | Steelseries Apex 7 | Steelseries Sensei Ten | ASUS VG35VQ

https://github.com/Mariusz89B

Permalänk
Medlem

Du vill ersätta var tredje rad i ena filen med var tredje rad i andra filen?

Om detta är en one-off skulle jag använda LibreOffice calc.

Läsa in bägge filerna till varsin kolumn och kombinera i en tredje kolumn som jag sedan sparar.

Annars en programsnurra som läser båda filerna en rad i taget och matar ut till en separat fil.

repeat read line a from file1 read line b from file2 write line a to file3 read line a from file1 read line b from file2 write line a to file3 read line a from file1 read line b from file2 write line b to file3 until end of file1 or end of file2

Visa signatur

Linux och Android

Permalänk
Medlem
Skrivet av Adoby:

Du vill ersätta var tredje rad i ena filen med var tredje rad i andra filen?

Om detta är en one-off skulle jag använda LibreOffice calc.

Läsa in bägge filerna till varsin kolumn och kombinera i en tredje kolumn som jag sedan sparar.

Annars en programsnurra som läser båda filerna en rad i taget och matar ut till en separat fil.

repeat read line a from file1 read line b from file2 write line a to file3 read line a from file1 read line b from file2 write line a to file3 read line a from file1 read line b from file2 write line b to file3 until end of file1 or end of file2

Grymt! Tack fungerar perfekt med LibreOffice Calc.

Visa signatur

AMD 7800X3D | ASUS TUF X670E-PLUS | Corsair Vengeance DDR5 32GB EXPO | ASUS TUF 4090 OC 24GB |
Noctua NH-U12A | Corsair 4000D | Corsair AX1200W | Steelseries Apex 7 | Steelseries Sensei Ten | ASUS VG35VQ

https://github.com/Mariusz89B