hi at all,
now, i have a new problem and started to write a script, but there is an error and i don't where.
the file looks like this:
i_lat = 214748 214748 214748 214748
214748 214748 214748 214748 214748 214748
214748 214748 214748 214748 214748 214748
214748 214748 214748 214748 792766 214748
214748 792809 792823 792837 214748 792866
792880 792894 792908 792923 214748 792951
214748 214748 792994 793009 793023 793037
i_lon = 214748 214748 214748 214748
214748 214748 214748 214748 214748 214748
214748 214748 214748 214748 214748 214748
214748 214748 214748 214748 193651 214748
214748 193642 193638 193635 214748 193628
193625 193622 193619 193615 214748 193609
214748 214748 193599 193596 193593 193590
now, i want to print all the data among each other, like this:
i_lat i_lon
xxxxx xxxxx
xxxxx xxxxx
xxxxx xxxxx
xxxxx xxxxx
xxxxx xxxxx
xxxxx xxxxx
my trying is this:
BEGIN {
print "lat lon"
}
$1 == "i_lat" {
lat[0]=$3
lat[1]=$4
lat[2]=$5
lat[3]=$6
for (i=4; i<40; i++) {
getline
lat=$1
lat=$2
lat=$3
lat=$4
lat=$5
lat=$6
}
for (i=10; i<40; i++) {
getline
lat=$1
lat=$2
lat=$3
lat=$4
lat=$5
lat=$6
}
for (i=16; i<40; i++){
getline
lat=$1
lat=$2
lat=$3
lat=$4
lat=$5
lat=$6
}
for (i=22; i<40; i++){
getline
lat=$1
lat=$2
lat=$3
lat=$4
lat=$5
lat=$6
}
for (i=28; i<40; i++){
getline
lat=$1
lat=$2
lat=$3
lat=$4
lat=$5
lat=$6
}
for (i=34; i<40; i++){
getline
lat=$1
lat=$2
lat=$3
lat=$4
lat=$5
lat=$6
}
$1 == "i_lon" {
lon[0]=$3
lon[1]=$4
lon[2]=$5
lon[3]=$6
for (i=4; i<40; i++) {
getline
lon=$1
lon=$2
lon=$3
lon=$4
lon=$5
lon=$6
}
for (i=10; i<40; i++) {
getline
lon=$1
lon=$2
lon=$3
lon=$4
lon=$5
lon=$6
}
for (i=16; i<40; i++){
getline
lon=$1
lon=$2
lon=$3
lon=$4
lon=$5
lon=$6
}
for (i=22; i<40; i++){
getline
lon=$1
lon=$2
lon=$3
lon=$4
lon=$5
lon=$6
}
for (i=28; i<40; i++){
getline
lon=$1
lon=$2
lon=$3
lon=$4
lon=$5
lon=$6
}
for (i=34; i<40; i++){
getline
lon=$1
lon=$2
lon=$3
lon=$4
lon=$5
lon=$6
}
for (i=0; i<40; i++) {
print lat lon
}
}
awk says the error is in line: for (i=0; i<40; i++){, but when i command this line out, it also doesn't work.
has anybody an idea?
thanks...tini
now, i have a new problem and started to write a script, but there is an error and i don't where.
the file looks like this:
i_lat = 214748 214748 214748 214748
214748 214748 214748 214748 214748 214748
214748 214748 214748 214748 214748 214748
214748 214748 214748 214748 792766 214748
214748 792809 792823 792837 214748 792866
792880 792894 792908 792923 214748 792951
214748 214748 792994 793009 793023 793037
i_lon = 214748 214748 214748 214748
214748 214748 214748 214748 214748 214748
214748 214748 214748 214748 214748 214748
214748 214748 214748 214748 193651 214748
214748 193642 193638 193635 214748 193628
193625 193622 193619 193615 214748 193609
214748 214748 193599 193596 193593 193590
now, i want to print all the data among each other, like this:
i_lat i_lon
xxxxx xxxxx
xxxxx xxxxx
xxxxx xxxxx
xxxxx xxxxx
xxxxx xxxxx
xxxxx xxxxx
my trying is this:
BEGIN {
print "lat lon"
}
$1 == "i_lat" {
lat[0]=$3
lat[1]=$4
lat[2]=$5
lat[3]=$6
for (i=4; i<40; i++) {
getline
lat=$1
lat=$2
lat=$3
lat=$4
lat=$5
lat=$6
}
for (i=10; i<40; i++) {
getline
lat=$1
lat=$2
lat=$3
lat=$4
lat=$5
lat=$6
}
for (i=16; i<40; i++){
getline
lat=$1
lat=$2
lat=$3
lat=$4
lat=$5
lat=$6
}
for (i=22; i<40; i++){
getline
lat=$1
lat=$2
lat=$3
lat=$4
lat=$5
lat=$6
}
for (i=28; i<40; i++){
getline
lat=$1
lat=$2
lat=$3
lat=$4
lat=$5
lat=$6
}
for (i=34; i<40; i++){
getline
lat=$1
lat=$2
lat=$3
lat=$4
lat=$5
lat=$6
}
$1 == "i_lon" {
lon[0]=$3
lon[1]=$4
lon[2]=$5
lon[3]=$6
for (i=4; i<40; i++) {
getline
lon=$1
lon=$2
lon=$3
lon=$4
lon=$5
lon=$6
}
for (i=10; i<40; i++) {
getline
lon=$1
lon=$2
lon=$3
lon=$4
lon=$5
lon=$6
}
for (i=16; i<40; i++){
getline
lon=$1
lon=$2
lon=$3
lon=$4
lon=$5
lon=$6
}
for (i=22; i<40; i++){
getline
lon=$1
lon=$2
lon=$3
lon=$4
lon=$5
lon=$6
}
for (i=28; i<40; i++){
getline
lon=$1
lon=$2
lon=$3
lon=$4
lon=$5
lon=$6
}
for (i=34; i<40; i++){
getline
lon=$1
lon=$2
lon=$3
lon=$4
lon=$5
lon=$6
}
for (i=0; i<40; i++) {
print lat lon
}
}
awk says the error is in line: for (i=0; i<40; i++){, but when i command this line out, it also doesn't work.
has anybody an idea?
thanks...tini