Hi awk users,
I am quite new to awk programming. I have a problem. I want to seperate between number Time (min) Discharge (cms) Can anyone help point out what I am missing here. Thanks for any help. Cheers,
character and alphabet character from a data file that I obtained as an output from
a program. The sample output is shown below;
___________________________________________________________________________
nrows, ncols, cell size: 14 29 152.439024
rowout, colout, sout:-29 -40 0.000800
simulating spatially distributed roughness
simulating spatially distributed raingage rainfall data
infiltration is computed
computational time step (sec), total simulation time (sec), and rainfall duration (sec): 60.00 5000 720
1.00 3.21 58.7715
2.00 3.21 58.7715
3.00 3.21 58.7715
4.00 3.21 58.7715
5.00 3.21 58.7715
6.00 3.21 58.7715
7.00 3.21 58.7715
8.00 3.21 58.7715
9.00 3.21 58.7715
10.00 3.21 58.7715
11.00 3.21 58.7715
12.00 3.21 58.7715
13.00 3.21 58.7715
14.00 3.21 58.7715
15.00 3.21 58.7715
16.00 3.21 58.7715
17.00 3.21 58.7715
18.00 3.21 58.7715
19.00 3.21 58.7715
20.00 3.21 58.7715
21.00 3.21 58.7715
___________________________________________________________________________
I would like to print only the number character and I wrote a short awk programme as
shown below;
***************************************************************************
BEGIN{
decimal = "[0-9]+[.]?[0-9]*"
fraction = "[.] [0-9]+"
number = "^" decimal fraction
$0 ~ number
{print}
***************************************************************************
However, I got the following error message, and I don't know what it is;
awk: syntax error near line 5
awk: illegal statement near line 5
Sorry, to post this problem to the netters since some of you might find it very easy.
Kamarul