Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

URGENT - AWK /NAWK

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
Hi

I have an awk program which runs fine. But when I ftp the same file into unix and run it as nawk (because my version of unix runs on solaris and does not support awk), it gives me strange output.

I would like to know whether this script which runs fine with awk utility will run the same way in nawk. Are there any command syntaxes to be changed before I run the awk script in nawk ???

Any help would be greatly appreciated.

Thanx....
 
I would recommend reading the man page for nawk.

man nawk

I should tell you the differences between nawk and awk.

Robert Robert G. Jordan

Robert@JORDAN2000.com
Unix Sys Admin
Chicago, Illinois U.S.A.
[lightsaber]
 
its of no use...any other inputs wud be greatly appreciated ....
 
Please post your script and/or the line code you are
having trouble with and the error messages.

Robert Robert G. Jordan

Robert@JORDAN2000.com
Unix Sys Admin
Chicago, Illinois U.S.A.
[lightsaber]
 
nawk -f extract_TC_BI.awk C0331900.tmp > C0331900_TC_BI.out
is the command I use from Unix prompt. It runs jus fine but gives me erroneous results

awk.exe -f c:\vendor\extract_TC_BI.awk c:\vendor\C0331900.tmp > c:\vendor\C0331900_TC_BI.out
is the script I run from the dos prompt (NT) which gives me jus the correct set of results.

Please not that I run Tr command b4 the execution of these scripts:
Tr.exe /\r/ /\a/ <c:\vendor\c0611300.dat > c:\vendor\c0611300.tmp in NT and UNIX.
 
In unix you need a capital F.

awk -F extract_TC_BI.awk

Or

awk -F &quot;extract_TC_BI.awk&quot;

should work.

Robert Robert G. Jordan

Robert@JORDAN2000.com
Unix Sys Admin
Chicago, Illinois U.S.A.
[lightsaber]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top