comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Extraction from *.txt file
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Extraction from *.txt file [message #91256 is a reply to message #91252] Tue, 23 June 2015 10:49 Go to previous messageGo to previous message
Paul Van Delst[1] is currently offline  Paul Van Delst[1]
Messages: 1157
Registered: April 2002
Senior Member
Hello,

I created a three pretend files based on your snippet below, and changed
the dates.

I would use something other than IDL as a preprocessor on your text files.

Rather than IDL, I would use grep:

$ grep "DATE OF RAW DATA ACQUISITION" *.txt
blah1.txt:DATE OF RAW DATA ACQUISITION: 19-APR-2006
blah2.txt:DATE OF RAW DATA ACQUISITION: 20-APR-2006
blah3.txt:DATE OF RAW DATA ACQUISITION: 21-APR-2006

If you just want the dates:

$ grep "DATE OF RAW DATA ACQUISITION" *.txt | cut -d":" -f3
19-APR-2006
20-APR-2006
21-APR-2006

If you want filenames and dates:

$ grep "DATE OF RAW DATA ACQUISITION" *.txt | cut -d":" -f1,3
blah1.txt: 19-APR-2006
blah2.txt: 20-APR-2006
blah3.txt: 21-APR-2006

You could use this to save to a "control" file, doing something like:

$ grep "DATE OF ...." *.txt | cut -d":" -f1,3 > ctrl.dat

And you can read "ctrl.dat" simply in IDL -- since you want every line,
right?

cheers,

paulv


On 06/23/15 11:19, dave poreh wrote:
> Folks,
> Hi,
> I have many *.txt files like this:
>
> E-SAR IMAGE DATA VOLUME, VERSION 3.1, PRODUCED BY
> GERMAN AEROSPACE CENTER (DLR e.V.)
> MICROWAVES AND RADAR INSTITUTE
> P.O.BOX 11 16
> D-82230 WESSLING, GERMANY
> Volume created on 11-Dec-2007 16:47:13.00
> Copyright (c) 2007 by DLR, all rights reserved.
> Suggestions welcome. Please mail to:
> RADAR: R. Horn, E-Mail: Ralf.Horn@dlr.de
> PROCESSING: R. Scheiber, E-Mail: Rolf.Scheiber@dlr.de
> J. Fischer, E-Mail: Jens.Fischer@dlr.de
> ============================================================ ==================
> SCENE-ID: I06AGRSAR0208X1_T01
> VOLUME-ID: I06AGRSAR0208X1_T01_GTC_RP-MASTER
> DATE OF RAW DATA ACQUISITION: 19-APR-2006
> ============================================================ ==================
> I.)-VOLUME DESCRIPTION
> This volume includes the following files (TOC)
> ...
>
> And I want to extrct line 15 that says :
> DATE OF RAW DATA ACQUISITION: 19-APR-2006
>
> And i need just (19-APR-2006).
> Any help would be apprecated,
> Thank and have a nice SUMMER :)
> Cheers,
> Dave
>
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Feature request: printing very long arrays
Next Topic: BYTSCL function

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 11:44:56 PDT 2025

Total time taken to generate the page: 0.00498 seconds