10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Field1=””
Field2=””
Field3=””
Field4=””
Field5=””
USER INPUT UP TO 5 FIELDS
awk -F , '{ if ( $3 == Field1 && $6 == Field2 && $8 == Field3 && $9 == Field4 && $10 == Field5) print $0 }' /tmp/rodney.outD
INPUT FILE (Rodney.outD):
... (3 Replies)
Discussion started by: rmerrird
3 Replies
2. Programming
Hi,
does someone know how to make a keyboard data input
in the AWK programming language ?
Regards
Zabo (6 Replies)
Discussion started by: Zabo
6 Replies
3. Shell Programming and Scripting
I have files named with different prefixes. From each I want to extract the first line containing a specific string, and then print that line along with the prefix.
I've tried to do this with a while loop, but instead of printing the prefix I print the first line of the file twice.
Files:... (3 Replies)
Discussion started by: pathunkathunk
3 Replies
4. Open Source
I have a process that requires me to read data from huge log files and find the most recent entry on a per-user basis. The number of users may fluctuate wildly month to month, so I can't code for it with names or a set number of variables to capture the data, and the files are large so I don't... (7 Replies)
Discussion started by: rbatte1
7 Replies
5. Shell Programming and Scripting
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
6. Shell Programming and Scripting
HI,
MY question is a very simple one:
if i want to call an awk script with the input file name and also pass a variable value , then how to do it.
#>awk -f my_script.awk -v variable=value my_inputfile.txt
I can't do it like this.
throws error:
awk: my_script.awk:18:... (0 Replies)
Discussion started by: Onkar Banerjee
0 Replies
7. Shell Programming and Scripting
this section of the awk code i have here takes file to work with from the user.
the user specifies the file name from the command line and the file name is assigned to the variable $FLIST
awk 'BEGIN {
while((getline < "'${FLIST}'")>0)
S
FS="\n"; RS="}\n"
}
now, i dont want... (5 Replies)
Discussion started by: SkySmart
5 Replies
8. Shell Programming and Scripting
Hi,
echo "Enter file name of input file list along with absolute path : "
read inputFileList
if
then
for string in `cat inputFileList`
do
echo $string
done
else
echo " file does not exist"
fi
From the above code, if the user enters a invalid file... (1 Reply)
Discussion started by: i.srini89
1 Replies
9. Shell Programming and Scripting
Hi Jim,
I have following script,i which i need to take dynamic value .
script,
nawk -v v1=grep"INT_EUR" $propertifilename | cut -d"=" -F2` -F'~' '{if (NF-1 !=v1)
{print "Error in " $0 " at line number "NR" tilde count " N-1}}' $filename
In the above script i want to use INT_EUR as a variable... (2 Replies)
Discussion started by: Ganesh Khandare
2 Replies
10. Shell Programming and Scripting
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