combining two text file with 100 equal number of header and body text
Afficher commentaires plus anciens
I am beginner for using matlab. I have two files each with 100 events formatted like below. Then I would like to combine them under each of the header in one file .
181123 1020 36.76 56.8409N 99.9979E 10.89 0.00 123 0.22
LS14RT 10.54LS13RT 11.84LS12RT 12.54LS11RT 12.54LS15RT 12.94LS16RT 14.54
LS67RT 15.34LS17RT 16.94LS45RT 18.84LS18RT 19.34LS44RT 20.04LS19RT 20.94
LS63RT 21.14CCGMRT 21.84LS22RT 23.04LS66RT 24.94LS39RT 25.14LS34RT 26.44
181123 1020 36.76 56.8409N 99.9979E 10.89 0.00 123 0.22
LS14RT 18.34LS13BT 20.64LS12BT 21.74LS11BT 22.04LS15BT 22.64LS16BT 25.04
LS67BT 26.24LS17BT 29.14LS45BT 32.44LS18BT 33.54LS44BT 34.34LS19BT 35.54
Like this. Is there any help on this please?
181123 1020 36.76 56.8409N 99.9979E 10.89 0.00 123 0.22
LS14RT 10.54LS13RT 11.84LS12RT 12.54LS11RT 12.54LS15RT 12.94LS16RT 14.54
LS67RT 15.34LS17RT 16.94LS45RT 18.84LS18RT 19.34LS44RT 20.04LS19RT 20.94
LS63RT 21.14CCGMRT 21.84LS22RT 23.04LS66RT 24.94LS39RT 25.14LS34RT 26.44
LS14RT 18.34LS13BT 20.64LS12BT 21.74LS11BT 22.04LS15BT 22.64LS16BT 25.04
LS67BT 26.24LS17BT 29.14LS45BT 32.44LS18BT 33.54LS44BT 34.34LS19BT 35.54
6 commentaires
Walter Roberson
le 19 Avr 2019
What is it that occurs 100 times? One header line and then 100 entries similar to the LS* entries? Or 100 groups of (one header line followed by a varying number of LS* entries) ?
Bujee
le 19 Avr 2019
Walter Roberson
le 19 Avr 2019
So that would be like
numeric header line #1
LS line #1-1
LS line #1-2
...
LS line #1-100
numeric header line #2
LS line #2-1
LS line #2-2
...
numeric header line #100
LS line #100-1
LS line #100-2
..
LS line #100-100
for a total of 100*(101) = 10100 lines per file, possibly more due to blank lines?
Bujee
le 19 Avr 2019
Guillaume
le 19 Avr 2019
The easiest way to make it completely clear is to attach two example text files to your question. It will also help answer what line ending and character encoding is used.
Bujee
le 19 Avr 2019
Réponse acceptée
Plus de réponses (1)
Bujee
le 25 Avr 2019
0 votes
Catégories
En savoir plus sur Title dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!