Hello all,
I hope someone out there can give me some advice on how I might put
together a loop that would take a file with two columns and n rows
the first field contains a number which indicates the number of times
a particular easting occurs in a file of coordinates representing nodes in
a road network. This file was processed to output the duplicate and unique
coordinates and the number of times they occur.
So i need to create a nested loop which will process the file n times and
within that loop echo the Easting the number of times it occurs in the original file >> into a file then go to the next line and
take the first field ( the number) and echo that easting the number of times
it occurs etc.
Any help would be greatly appreciated.
Bill Jackson
USACERL
I hope that I have understood your question correctly but I think
this line should do the trick.
cat file | awk '{ for ( i=1; i <= $1 ; i++ ) print $2 }'
Lars
Lars Schylberg Email: larss@fmi.kth.se
Dept. of Geodesy and Photogrammetry
Royal Institute of Technology (KTH) Tel. +46 8 790 86 33
S-100 44 STOCKHOLM, SWEDEN Fax. +46 8 790 66 10
I hope someone out there can give me some advice on how I might put
together a loop that would take a file with two columns and n rows
the first field contains a number which indicates the number of times
a particular easting occurs in a file of coordinates representing nodes in
a road network. This file was processed to output the duplicate and unique
coordinates and the number of times they occur.
So i need to create a nested loop which will process the file n times and
within that loop echo the Easting the number of times it occurs in the original file >> into a file then go to the next line and
take the first field ( the number) and echo that easting the number of times
it occurs etc.