Documentation for pp_lib

Generated by IDLdoc

single page | use frames     summary     class     fields     routine details     file attributes

./

pp_readtxt.pro


Author information

Author

Paulo Penteado (http://www.ppenteado.net), Feb/2014

Routines

top source pp_readtxt

result = pp_readtxt(file [, count])

Reads a text file into a string array. Each line of the text file becomes one element of the string array.

Return value

A string array with the file contents, one element per line in the file.

Parameters

file in required

A string with the name of the file to read.

count out optional

Returns the number of lines read from the file

Examples

Read the example file ascii.txt included with IDL:

fp=filepath('ascii.txt',subdir=['examples','data']) contents=pp_readtxt(fp) help,contents ;CONTENTS STRING = Array[20] print,contents[0:3],format='(A)' ; This file contains ASCII format weather data in a comma delimited table ; with comments prefaced by the "%" character. The columns represent: ; Longitude, latitude, elevation (in feet), temperature (in degrees F), ; dew point (in degrees F), wind speed (knots), wind direction (degrees)

Author information

Author:

Paulo Penteado (http://www.ppenteado.net),

Statistics

Lines:
9 lines
Cyclomatic complexity:
1
Modified cyclomatic complexity:
1

File attributes

Modification date: Wed Jun 29 22:15:28 2016
Lines: 9
Docformat: rst rst