09-27-2005
awk data validation
Hi ,
This is a general doubt....
Is there any way to do data validation inside an awk script..
Let me make it more clear....
I have a string variable inside awk script .. Is there any way to check whether it is number or string etc...
Thanks in advance.
Shihab
9 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Hello,
I am trying to use data validation with a program. I have everything else working fine. I just can't figure out what I am doing wrong with the data validation in one of my files. Here is the code:
# data validation loop
while :
do
# get input from keyboard
... (2 Replies)
Discussion started by: ericelysia
2 Replies
2. Shell Programming and Scripting
Hello People
I have the following file.csv:
date,string,float,number,boolean
20080303,abc,1.5,123,Y
20080304,abc,1.2,345,N
20080229,nvh,1.4,098,Y
20080319,ugy,1.9,586,N
20080315,gyh,2.4,345,Y
20080316,erf,3.1,932,N
I need to filter the date field where I have a data bigger than I... (1 Reply)
Discussion started by: Rafael.Buria
1 Replies
3. Shell Programming and Scripting
How to validate a date and optionly a time in shell scripting when i get the date and time as pararmeters that sent out with the call of the file? (in my case sh union.sh `first parameter ,second parameter...` (4 Replies)
Discussion started by: tal
4 Replies
4. Shell Programming and Scripting
I have a comma delimited file that I need to validate the data in one two columns in.
Sample File:
1234,1234,1234,DESCRIPTION,1,1,2
1234,1234,1234,DESCRIPTION,1,1,2
1234,1234,1234,DESCRIPTION,1,1,2
1234,1234,1234,DESCRIPTION,1,1,2
I need to make sure that the second column's entries are... (3 Replies)
Discussion started by: hmnetonline
3 Replies
5. Shell Programming and Scripting
Hello,
I am working on an interface between a legacy system and an ERP system.The format of the data extracted into the staging folder from the legacy system is a follows.
One control file named ExtractDataControl.txt
Multiple entity files eg R1001.txt, R1002.txt, R1020.txt
The control... (5 Replies)
Discussion started by: Savio_Saldanha
5 Replies
6. Shell Programming and Scripting
hpux. older version. don't have alot of the newer features in some utilities.
How do I verify that a variable starts with the letter A. I would like to make it case insensitive.
Also, if I have a variable that has letters and numbers. I want to change all the lower case letters to upper case.... (2 Replies)
Discussion started by: guessingo
2 Replies
7. Shell Programming and Scripting
Generic Data validator
Data file:
Name,Sal,Dept
ABC,1234,D1
AYX,12356,D2
DHF,345,ED3
123,4565,FGJG
Config File:
Delimiter-","
Rule1-Name-
Rule2-Sal-
Rule3-Dept-*
Can be used to match any regex including date different format and numbers. (3 Replies)
Discussion started by: dikesm
3 Replies
8. Shell Programming and Scripting
Hi All,
I am completely new to Unix Shell Scripting.
I m validating(Basic File Validation) an .HHT file in TIBCO.
After that i need to do Data Validation through UNIX Shell scripting.
Rules in DataValidation:
1.) Need to Check Every field wheather it is a Char or Number?(Fields are... (1 Reply)
Discussion started by: Chaitanya K
1 Replies
9. Shell Programming and Scripting
I am using below logic to validate whether i am expecting the correct data from source,if not logic should give which column has error.i am running below logic in linux
awk -F, '
NR==1{next}
{f=" "}
$1!~/^{0,5}$|^$/{f=f?f" emp_id-error":"emp_id-error"}
$4!~/^{0,6}$|^$/{f=f?f"... (4 Replies)
Discussion started by: katakamvivek
4 Replies
LEARN ABOUT OPENSOLARIS
igawk
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).
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+--------------------+-----------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+--------------------+-----------------+
|Availability | SUNWgawk |
+--------------------+-----------------+
|Interface Stability | Volatile |
+--------------------+-----------------+
NOTES
Source for gawk is available on http://opensolaris.org.
Free Software Foundation Nov 3 1999 IGAWK(1)