Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem reading data 1

Status
Not open for further replies.

fabien

Technical User
Sep 25, 2001
299
AU
HI!

Part of my script is to read some input file and extract some info like:

Code:
nwells = 0
	while ( ( getline < inputfile ) > 0 ) {
		nwells++
		common[nwells] = $3
		uwi[nwells] = $7
	
	}
[\code]

the inputfile looks like
Well Name: Adzva-Vost 1        Unique Well ID: WB268736


The problem is that the well name like "Adzva-Vost 1" in this case can have spaces in the name so common[nwells] = $3 only picks up part of the name. How can I deal with this?

Thanks!
 
Something like this ?
nwells = 0
while ( ( getline < inputfile ) > 0 ) {
nwells++
common[nwells] = $3
i=4;while($i!="Unique")common[nwells]=common[nwells]" "$(i++)
uwi[nwells] = $NF
}

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top