I have the following code:
i = $1
while ($1 != "These" && $1 ~ /[A-Za-z0-9]/ || substr($1,1,4) ~ /____/)
{
getline
{
test[i++] = $0
i++
}
}
and then later I do a
printf ("%s\n",date2) >> fn
printf ("%s\n",ipc) >> fn
printf ("%s\n",domain2) >> fn
printf ("%s\n",browser) >> fn
for (i in test)
{
printf ("%s\n",test) >> fn
}
printf ("%s\n",shipto) >> fn
printf ("%s\n",shipname) >> fn
I get all the data from the getline function but the lines don't print in the order they are read by the file. Can anyone tell me how I get them to print in the order they were read?
i = $1
while ($1 != "These" && $1 ~ /[A-Za-z0-9]/ || substr($1,1,4) ~ /____/)
{
getline
{
test[i++] = $0
i++
}
}
and then later I do a
printf ("%s\n",date2) >> fn
printf ("%s\n",ipc) >> fn
printf ("%s\n",domain2) >> fn
printf ("%s\n",browser) >> fn
for (i in test)
{
printf ("%s\n",test) >> fn
}
printf ("%s\n",shipto) >> fn
printf ("%s\n",shipname) >> fn
I get all the data from the getline function but the lines don't print in the order they are read by the file. Can anyone tell me how I get them to print in the order they were read?