Sponsored Content
Special Forums UNIX and Linux Applications Parsing info from a text file into an IDL procedure Post 302241966 by msb65 on Tuesday 30th of September 2008 06:52:59 PM
Old 09-30-2008
Parsing info from a text file into an IDL procedure

Hi,

I hope this is appropriate for this forum.

I have a text file (test.txt) that contains information that I would like to parse into an IDL procedure. Each line of the text file is either a number or a string, which will be a variable in my IDL procedure. Therefore I want to read each line of the text file and store it as a separate variable. I think I have figured out how to do that.

openr, lun, 'test.txt', /get_lun
readf, lun, IDL_var#
'' '' ''
'' '' ''
free_lun, lun

The above code works if the lines of the text file are numbers. If the line is a string then I must first have: IDL_var#=''. This has worked so far because I have constructed my text file so that the IDL code knows which lines will be numbers, and which will be strings.

Here are my questions:

- Is there a better way to parse info from a text file into an IDL procedure?
- IMPORTANT: I currently have a variable that I would like to pass into the IDL procedure which will either be a string or a number. How can I make readf function blind to this? I won't be able to tell it in advance the type of variable.

Thank you for any help,
Mike
 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

compiling idl file on unix

hi i need to compile idl files to convert them to classes, on Unix platform. Please tell me how to compile these files & which commands are to be used for this purpose. Thanks & Regards (6 Replies)
Discussion started by: rochitsharma
6 Replies

2. Shell Programming and Scripting

Text File Parsing

Hey Guys.I am a newbie on Bash Shell Scripting and Perl.And I have a question about file parsing. I have a log file which contains reports about a communication device.I need to take some of the reports from the log file.Its hard to explain the issue.but shortly I can say that, the reports has a... (2 Replies)
Discussion started by: Djlethal
2 Replies

3. Shell Programming and Scripting

Parsing text from file

Any ideas? 1)loop through text file 2)extract everything between SOL and EOL 3)output files, for example: 123.txt and 124.txt for the file below So far I have: sed -n "/SOL/,/EOL/{p;/EOL/q;}" file Here is an example of my text file. SOL-123.go something goes here something goes... (0 Replies)
Discussion started by: ndnkyd
0 Replies

4. Shell Programming and Scripting

Finding & Moving Oldest File by Parsing/Sorting Date Info in File Names

I'm trying to write a script that will look in an /exports folder for the oldest export file and move it to a /staging folder. "Oldest" in this case is actually determined by date information embedded in the file names themselves. Also, the script should only move a file from /exports to... (6 Replies)
Discussion started by: nikosey
6 Replies

5. Shell Programming and Scripting

Need help parsing a text file

I have a text file: router1#sh ip blah blah | incl --- Gi2/8 10.60.4.181 --- 10.60.123.175 11 0000 0000 355K Gi2/8 10.60.83.28 --- 224.10.10.26 11 F9FF 3840 154K Gi2/8 10.60.83.198 --- ... (1 Reply)
Discussion started by: streetfighter2
1 Replies

6. Shell Programming and Scripting

Help to get the Output of PL/SQL procedure In a Excel or Text File

Hi, Could anyone please guide me to get the output of the PL/SQL procedure in a Excel file or Text File... Thanks (1 Reply)
Discussion started by: funonnet
1 Replies

7. Programming

Parsing a Text file using C++

I was trying to parse the text file, which will looks like this ###XYZABC#### ############ int = 4 char = 1 float = 1 . . ############ like this my text file will contains lots of entries and I need to store these entries in the map eg. map.first = int and map.second = 4 same way I... (5 Replies)
Discussion started by: agupta2
5 Replies

8. Shell Programming and Scripting

Parsing text file

I'm totally stumped with how to handle this huge text file I'm trying to deal with. I really need some help! Here is what is looks like: ab1ba67c331a3d731396322fad8dd71a3b627f89359827697645c806091c40b9 0.2 812a3c3684310045f1cb3157bf5eebc4379804e98c82b56f3944564e7bf5dab5 0.6 0.6... (3 Replies)
Discussion started by: comp8765
3 Replies

9. Shell Programming and Scripting

Parsing text file

Hi Friends, I am back for the second round today - :D My input text file is this way Home friends friendship meter Tools Mirrors Downloads My Data About Us Help My own results BLAT Search Results ACTIONS QUERY SCORE START END QSIZE IDENTITY CHRO STRAND ... (7 Replies)
Discussion started by: jacobs.smith
7 Replies

10. UNIX for Advanced & Expert Users

How to extract info from text file between the tags

Hi, I have a text file with member information... B]Name is in H1 tag Title is in H2 tag Email is in <a id="ctl00_ContentPlaceHolder3_repeaterItems_ctl01_lbnEmailMe" href="javascript:__doPostBack('ctl00$ContentPlaceHolder3$repeaterItems$ctl01$lbnEmailMe','')">someone@company.com</a> Location:... (6 Replies)
Discussion started by: igurv
6 Replies
libIDL-2.3(3)						 Introduction to Library Functions					     libIDL-2.3(3)

NAME
libIDL-2 - IDL parsing library DESCRIPTION
The libIDL library provides an API for parsing CORBA Interface Definition Language (IDL) files and manipulating the resultant parse tree. libIDL is used by orbit-idl-2(1), the GNOME IDL compiler. No API documentation is currently supplied with the library. FILES
The following files are used by this application: /usr/lib/libIDL-2.so IDL parsing shared library ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-------------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-------------------------------+ |Availability |SUNWgnome-component-arch-devel | +-----------------------------+-------------------------------+ |Interface stability |External | +-----------------------------+-------------------------------+ SEE ALSO
orbit-idl-2(1), libORBit-2(3) NOTES
Written by Mark McLoughlin, Sun Microsystems Inc., 2003. SunOS 5.10 10 Jan 2003 libIDL-2.3(3)
All times are GMT -4. The time now is 01:56 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy