HI: I am using o'reilly book sed & awk and experimenting with examples in book using DOS and nawk/awk.
Data file:john robinson
koren inc.
978 common ave
boston
ma 01760
696-0987
THIS IS A MULTILINE RECORD WITH 6 FIELDS.
the book shows begin {FS = "\n";RS = ""}
{ print $1,$NF }
the output shows name and telephone#.($1,$NF).
i cannot duplicate this using the same code.i created the data file with windows notepad which shows after each field a hex(od oa)cr\lf.the output is all the fields (as if awk does'nt see BEGIN at all.if i change the cr\lf to the unix \n (oa)the output remains the same, NOT the first and last(name and telephonen#) but all fields as shown.I believe senility has set in,so stay with me.thank you.
P.S. i believe that the relationship with windows cr\lf and \n in unix may be my downfall but i do not know how to correct this.
Data file:john robinson
koren inc.
978 common ave
boston
ma 01760
696-0987
THIS IS A MULTILINE RECORD WITH 6 FIELDS.
the book shows begin {FS = "\n";RS = ""}
{ print $1,$NF }
the output shows name and telephone#.($1,$NF).
i cannot duplicate this using the same code.i created the data file with windows notepad which shows after each field a hex(od oa)cr\lf.the output is all the fields (as if awk does'nt see BEGIN at all.if i change the cr\lf to the unix \n (oa)the output remains the same, NOT the first and last(name and telephonen#) but all fields as shown.I believe senility has set in,so stay with me.thank you.
P.S. i believe that the relationship with windows cr\lf and \n in unix may be my downfall but i do not know how to correct this.