Sponsored Content
Top Forums UNIX for Dummies Questions & Answers awk code does not receive input Post 302872795 by MadeInGermany on Sunday 10th of November 2013 04:46:46 AM
Old 11-10-2013
awk takes a file as input.
The $1 $2 are set from its fields.
Give the file name as parameter.
Addional parameters can set awk variables.
For example, assuming your awk code is saved in the file awkscript
Code:
awk -v EASTING=1 -v NORTHING=2 -f awkscript inputfile


Last edited by MadeInGermany; 11-11-2013 at 05:40 AM.. Reason: -f not -F
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

awk - input function

hello, im a newbie. how can i input data from keyboard? thanks. (3 Replies)
Discussion started by: Jariya
3 Replies

2. Shell Programming and Scripting

awk/input parameter

Hi, My script takes in one input parameter($1-email id) on the command line... The script contains something like this... awk '$1 == 400' abc.log >def.log mail -s subject $1 <def.log abc.log looks something like this... 300 222 330 123 445 400 098 890 727 663 How do i make the... (3 Replies)
Discussion started by: wannalearn
3 Replies

3. Shell Programming and Scripting

2 input files for awk

Hi, i have 2 files like f1 and f2 f1: 1 Note: some times it will be cahnged to 2 and 3. f2: 1:20 2:30 4:50 6:70 8:90 3:20 1:30 1:40 output: 1:80 (sum of 1) (6 Replies)
Discussion started by: koti_rama
6 Replies

4. Shell Programming and Scripting

awk user input

Using the following I'm trying to print the user's response to the prompt Y / N but I get nothing other than the contents of $1? awk '{ printf($1 " ? (Y/N)") getline myresponse < "-" system("read myresponse") if (myresponse == "Y") { print $1... (17 Replies)
Discussion started by: gefa
17 Replies

5. Shell Programming and Scripting

AWK using two input files

Hi , i have two input files one is input.gz and another is ( input.txt) text file.in gz format input file each record contains 10 fields and corresponding header value is present in the text file as a single record i.e text file contains only 10 records which is header value,so output of the awk... (1 Reply)
Discussion started by: Ajoy
1 Replies

6. Shell Programming and Scripting

Hard code the input of a script

Hi All, I have a script Abc . This is has only the privilege of execution. I cannot see the code. When I run the script "Abc" , It display set of name in an random order with a number 1.e 1 James 2 john 3 jack 4 neil 5 bob If my name is neil , I am expected to type 4 and press enter Now... (5 Replies)
Discussion started by: mailvkjain
5 Replies

7. Shell Programming and Scripting

Parse input -AWK

Input File Defined configuration: cfg: CLL_DCC_Fabric_A BTS00P21; BAU_AP00P01QC; BAU_LGSCNJP02; BAU_TS00P20; BAU_DSMSM14; BAU_HT00P02; BAU_DSMSM13; BAU_HT00P01; cfg: CX0014_list BAU_TS00P20; BAU_NYP_PRODIAD1_CJ;... (5 Replies)
Discussion started by: greycells
5 Replies

8. Shell Programming and Scripting

User input in perl code

Hello friends . I am newbie to perl scripting but still managed to write a code but i am stuck at a place where i need help . Below is the code and can someone help me in taking user input for changing the font size for a html table .Thank you in advance #!/bin/ksh echo " Enter the Directory... (4 Replies)
Discussion started by: ajayram_arya
4 Replies

9. Shell Programming and Scripting

User input and run awk using the input

I am trying to allow a user to enter in text and then store that text in a variable $gene to run in an awk command in which those values are used to run some calculations. I am getting syntax errors however, when I try. Thank you :). The awk runs great if it is a pre-defined file that is used,... (7 Replies)
Discussion started by: cmccabe
7 Replies

10. Red Hat

Looking for C code for MQ server to sed/receive messages

I am working on C program to connect to MQ websphere server send/receive messages. Can somebody give me examples of such program? Thanks for contribution (0 Replies)
Discussion started by: digioleg54
0 Replies
IGAWK(1)							 Utility Commands							  IGAWK(1)

NAME
igawk - gawk with include files SYNOPSIS
igawk [ all gawk options ] -f program-file [ -- ] file ... igawk [ all gawk options ] [ -- ] program-text file ... DESCRIPTION
Igawk is a simple shell script that adds the ability to have ``include files'' to gawk(1). AWK programs for igawk are the same as for gawk, except that, in addition, you may have lines like @include getopt.awk in your program to include the file getopt.awk from either the current directory or one of the other directories in the search path. OPTIONS
See gawk(1) for a full description of the AWK language and the options that gawk supports. EXAMPLES
cat << EOF > test.awk @include getopt.awk BEGIN { while (getopt(ARGC, ARGV, "am:q") != -1) ... } EOF igawk -f test.awk SEE ALSO
gawk(1) Effective AWK Programming, Edition 1.0, published by the Free Software Foundation, 1995. AUTHOR
Arnold Robbins (arnold@skeeve.com). Free Software Foundation Nov 3 1999 IGAWK(1)
All times are GMT -4. The time now is 04:50 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy