|
|
sort txt - file with MATLAB |
|
oTTo |
Forum-Newbie
|
|
Beiträge: 3
|
|
|
|
Anmeldedatum: 23.07.11
|
|
|
|
Wohnort: ---
|
|
|
|
Version: ---
|
|
|
|
|
|
Verfasst am: 23.07.2011, 20:55
Titel: sort txt - file with MATLAB
|
|
|
|
|
Hello together
I have a .txt file with about 1Mio! rows.
Sometimes the rows are in the following order (whereas the number of rows between the rows in bold differ):
...
SBLINK R 526150
5261439 516.4 364.3 9148.0 ... 816.0 -1133.0
5261441 516.4 364.0 9145.0 ... 799.0 -1135.0
5261443 516.4 363.9 9140.0 ... 817.0 -1171.0
MSG 5261445 Prime 11_fe_ha
5261445 516.7 363.8 9133.0 ... 813.0 -1097.0
5261447 517.0 363.8 9127.0 ... 818.0 -1144.0
EBLINK R
5261507 5261645 140
5261509 . . 0.0 ... . . . .............
5261511 . . 0.0 ... . . . .............
MSG 5261512 Mask 8_ma_ma
5261513 . . 0.0 ... . . . .............
5261515 . . 0.0 ... . . . .............
...
Here I would like to generate an output, that gives me the two parts "...Prime 11_fe_ha" and "...Mask 8_ma_ma" if and only if "...Prime 11_fe_ha" is situated between "SBLINK..." and "EBLINK...".
Sometimes the rows are in the following order (whereas the number of rows between the rows in bold differ):
...
MSG 5261445 Prime 11_fe_ha
5261439 516.4 364.3 9148.0 ... 816.0 -1133.0
5261441 516.4 364.0 9145.0 ... 799.0 -1135.0
5261443 516.4 363.9 9140.0 ... 817.0 -1171.0
SBLINK R 5261507
5261445 516.7 363.8 9133.0 ...
5261447 517.0 363.8 9127.0 ... 818.0 -1144.0
EBLINK R
5261507 5261645 140
5261509 . . 0.0 ... . . . .............
5261511 . . 0.0 ... . . . .............
MSG 5261512 Mask 8_ma_ma
5261513 . . 0.0 ... . . . .............
5261515 . . 0.0 ... . . . .............
...
Here I would like to generate an output, that consists of the two parts "...Prime 11_fe_ha" and "...Mask 8_ma_ma" if and only if "SBLINK..." is situated between "... Prime 11_fe_ha" and "...Mask 8_ma_ma". The place of the "EBLINK..." is not important. that means also the following structure should lead to the same output:
...
MSG 5261445 Prime 11_fe_ha
5261439 516.4 364.3 9148.0 ... 816.0 -1133.0
5261441 516.4 364.0 9145.0 ... 799.0 -1135.0
5261443 516.4 363.9 9140.0 ... 817.0 -1171.0
SBLINK R 5261507
5261445 516.7 363.8 9133.0 ... 813.0 -1097.0
5261447 517.0 363.8 9127.0 ... 818.0 -1144.0
5261509 . . 0.0 ... . . . .............
5261511 . . 0.0 ... . . . .............
MSG 5261512 Mask 8_ma_ma
5261513 . . 0.0 ... . . . .............
5261515 . . 0.0 ... . . . .............
EBLINK R 5261507 5261645 140
...
can someone give me a advice how I could manage this task?
thanks
best
|
|
|
|
|
eupho |
Forum-Meister
|
|
Beiträge: 777
|
|
|
|
Anmeldedatum: 07.01.09
|
|
|
|
Wohnort: Marburg
|
|
|
|
Version: R2009b
|
|
|
|
|
|
Verfasst am: 24.07.2011, 07:43
Titel:
|
|
What have you tried yet and what are your specific questions?
|
|
|
oTTo |
Themenstarter
Forum-Newbie
|
|
Beiträge: 3
|
|
|
|
Anmeldedatum: 23.07.11
|
|
|
|
Wohnort: ---
|
|
|
|
Version: ---
|
|
|
|
|
|
Verfasst am: 24.07.2011, 09:29
Titel:
|
|
Hello
My problem is that I have no clue about MATLAB. But I heard at university that MATLAB should be able to do stuff like this. So far I just did some applications in excel, but this is a unappropriate task due to the limit of about 70'000 rows.
Do you know any comments in MATLAB that would fit to that topic? Or do you know any other programs that could help me to do this task?
Then I could go after them and evaluate what I have to do to solve this problem.
greets
|
|
|
Andy386 |
Forum-Guru
|
|
Beiträge: 485
|
|
|
|
Anmeldedatum: 24.06.09
|
|
|
|
Wohnort: ---
|
|
|
|
Version: 7.1/8
|
|
|
|
|
|
Verfasst am: 24.07.2011, 10:03
Titel:
|
|
maybe C(++) or something else would fit better, but you also can use matlab...
What do you want to do with the "important" data?
Calculating, plotting, ...?
_________________
Ich hasse es wenn die Leute Fragen stellen, man dann versucht sich Mühe zu geben, und diejenigen ihren Thread nie wieder besuchen...
|
|
|
oTTo |
Themenstarter
Forum-Newbie
|
|
Beiträge: 3
|
|
|
|
Anmeldedatum: 23.07.11
|
|
|
|
Wohnort: ---
|
|
|
|
Version: ---
|
|
|
|
|
|
Verfasst am: 24.07.2011, 11:02
Titel:
|
|
okay, many thanks to you both. So I will check out what I can do with MATLAB and C++.
finally, the "important" data determines which parts of an other data set (including the same "Prime and Mask" data) have to be excluded. I don't do any calculations or plotting with these data.
best,
|
|
|
Andy386 |
Forum-Guru
|
|
Beiträge: 485
|
|
|
|
Anmeldedatum: 24.06.09
|
|
|
|
Wohnort: ---
|
|
|
|
Version: 7.1/8
|
|
|
|
|
|
Verfasst am: 27.07.2011, 10:59
Titel:
|
|
so it seems to be more on file handling and parsing -> C/++/#
_________________
Ich hasse es wenn die Leute Fragen stellen, man dann versucht sich Mühe zu geben, und diejenigen ihren Thread nie wieder besuchen...
|
|
|
|
|
Einstellungen und Berechtigungen
|
|
Du kannst Beiträge in dieses Forum schreiben. Du kannst auf Beiträge in diesem Forum antworten. Du kannst deine Beiträge in diesem Forum nicht bearbeiten. Du kannst deine Beiträge in diesem Forum nicht löschen. Du kannst an Umfragen in diesem Forum nicht mitmachen. Du kannst Dateien in diesem Forum posten Du kannst Dateien in diesem Forum herunterladen
|
|
Impressum
| Nutzungsbedingungen
| Datenschutz
| FAQ
| RSS
Hosted by:
Copyright © 2007 - 2025
goMatlab.de | Dies ist keine offizielle Website der Firma The Mathworks
MATLAB, Simulink, Stateflow, Handle Graphics, Real-Time Workshop, SimBiology, SimHydraulics, SimEvents, and xPC TargetBox are registered trademarks and The MathWorks, the L-shaped membrane logo, and Embedded MATLAB are trademarks of The MathWorks, Inc.
|
|