Jump to content

Andre

New Members
  • Posts

    2
  • Joined

  • Last visited

    Never

Everything posted by Andre

  1. Thank you very very very much! This is the perfect solution :-) RegEx had always been a big mysterium for me...
  2. I coded a script, which parses incoming data from an mailbox (imap via socket), from which I now need to extract the data. What is the best way to do this? I had several attempts with regular expressions but never got something well working... I cutted at '\r\n' and had one array per datapackage which I then searched for keywords with strpos() [e.g. 'Date'] and then used substr() to get the data [e.g. 18.11.01 00:04:04] Maybe someone here has a better solution!! The big problem is that some values don't have a fixed number of digits, which makes substr() not a very good choice... [b]Desired data:[/b] Date, Lc, Lat1 - Lon2, Pass duration, Altitude [b] Data Example [/b] (attention: Additional white spaced missing in this post.) 1234 Date : 18.11.01 00:04:04 LC : 1 IQ : 50 Lat1 : 0.997N Lon1 : 86.470E Lat2 : 7.013N Lon2 : 60.194E Nb mes : 006 Nb mes>-120dB : 000 Best level : -124 dB Pass duration : 236s NOPC : 3 Calcul freq : 401 652669.6 Hz Altitude : 0 m 00 46 02 00 00 00 00 00 00 240 00 00 00 03 195 195 1234 Date : 18.11.01 01:36:18 LC : A IQ : 08 Lat1 : 0.998N Lon1 : 86.502E Lat2 : 10.384N Lon2 : 44.491E Nb mes : 003 Nb mes>-120dB : 000 Best level : -131 dB Pass duration : 282s NOPC : 3 Calcul freq : 401 652667.5 Hz Altitude : 0 m 00 46 08 00 00 00 00 00 00 248 00 00 00 00 00 218 3214 Date : 18.11.01 03:09:08 LC : 2 IQ : 58 Lat1 : 1.004N Lon1 : 86.530E Lat2 : 0.103N Lon2 : 90.360E Nb mes : 012 Nb mes>-120dB : 000 Best level : -124 dB Pass duration : 788s NOPC : 4 Calcul freq : 401 652664.2 Hz Altitude : 0 m 00 45 238 02 181 41 74 86 165 43 90 150 173 93 212 05 (possibly one additional whitespace in front of the 4-digit numbers in front)
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.