Sponsored Content
Top Forums Shell Programming and Scripting Help With UNIX Shell Scripting For Data Validation Post 302811849 by Chaitanya K on Friday 24th of May 2013 10:11:12 AM
Old 05-24-2013
Help With UNIX Shell Scripting For Data Validation

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 seperated bya Delimeter ||)
2.) Need to check the DateFormat. It should be (dd/mm/yyyy hh:mm:ss)
3.) Need to check the Nullabality(null or notNull)
4.) Need to Check Length --> Should be within the range

Now i need to validate all the rows/Records in that File and the
Passed records which satisfies the above criteria should write into another File
the failed records should Write into different File.


Sample File:

Code:
LOCAL_AUDITOR_ID||LOCAL_COLLECTION_PERIOD_CODE||Barcode||START_TIME_DATE
AGDFSCVDFR||PATELKUMAR||1234567890||2/11/2012 09:36:00
AGDFSCVDFR||PATELKUMAR||abcdefghij||2/11/2012 09:36:00
AGD12CVDFR||PATELKUMAR||Abcd123456||2/11/2012 09:36:00
AGDFSCVDFR||PATELKUMAR||12345ndb90||2/11/2012 09:36:00

Note: 1st Record(row)--> List of Columns

Code:
LOCAL_AUDITOR_ID --> Char(15)
LOCAL_COLLECTION_PERIOD_CODE--Char
Barcode--> Number(10)
START_TIME_DATE--Char


Last edited by jim mcnamara; 05-24-2013 at 11:19 AM..
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

difference between AIX shell scripting and Unix shell scripting.

please give the difference between AIX shell scripting and Unix shell scripting. (2 Replies)
Discussion started by: haroonec
2 Replies

2. Shell Programming and Scripting

data formatting in Unix shell Scripting

#! /bin/ksh ############################ # AFI Monitor Script ############################ . /db2/uszlad48/sqllib/db2profile export mondir=/home/script/krishna export monlog=$mondir/Error_Report_`date +%Y%m%d`.log echo "connect to database r2pdev" >>$monlog db2 connect to r2pdev user... (1 Reply)
Discussion started by: regnumber
1 Replies

3. UNIX for Dummies Questions & Answers

How to cut data block from .txt file in shell scripting

Hi All, Currently i have to write a script. For which i need to cut a block from .txt file. I know the specific word that starts the block and ends the block. Can we do it in shell scripting..? Please suggest.... (6 Replies)
Discussion started by: pank29
6 Replies

4. Shell Programming and Scripting

shell script data & time validation

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

5. Shell Programming and Scripting

Shell scripting to extract data from file

Hi, i want to fetch the data from the alert log file, for a particular time interval. Example : Alert log content : Thu Mar 18 08:47:36 2010 Completed: alter database open Thu Mar 18 19:13:38 2010 MMNL absent for 6390 secs; Foregrounds taking over Fri Mar 19 08:30:52 2010... (1 Reply)
Discussion started by: Pinki018
1 Replies

6. Shell Programming and Scripting

Extracting data from file-shell scripting--please help

hello friends, my file is like 123 |asd|asd|asd 123_1|awd|asw|asw 121 |wer|qwe|wee 124 |weq|qwe|iop 1_23 |bla|blh|bha 145 |ghj|jkl|ghj 146 |qwe|qwe|wer 154 |asd|wer|qw_e 134_5|qwe|wer|qw_e is their any solution to retrive only those lines which are having only 3 numerical letters... (20 Replies)
Discussion started by: PankajChawla
20 Replies

7. Shell Programming and Scripting

How to extract data from xml file using shell scripting?

Hi evry1, This is my 1st post in this forum.Pls help me I want to extract some data froma xml file which has 2000 lines using shell scripting. Actually my xml file has some "audio and video codes" which i need to arrange in a column wise format after extracting it using shell scripting.I... (4 Replies)
Discussion started by: arun_kohan
4 Replies

8. Shell Programming and Scripting

How to extract data from XML file using shell scripting?

Hi , I have input file as XML. following are input data #complex.xml Code: <?xml version="1.0" encoding="UTF-8"?><TEST_doc xmlns="http://www.w3.org/2001/XMLSchema-instance"> <ENTRY uid="123456"> <protein> <name>PROT001</name> <organism>Human</organism> ... (1 Reply)
Discussion started by: arun_kohan
1 Replies

9. UNIX for Dummies Questions & Answers

Shell script to read lines in a text file and filter user data Shell Programming and Scripting

sxsaaas (3 Replies)
Discussion started by: VikrantD
3 Replies

10. Shell Programming and Scripting

Read csv file, convert the data and make one text file in UNIX shell scripting

I have input data looks like this which is a part of a csv file 7,1265,76548,"0102:04" 8,1266,76545,"0112:04" I need to make the output data should look like this and the output data will be part of text file: 7|1265000 |7654899 |A| 8|12660000 |76545999 |B| The logic behind the... (6 Replies)
Discussion started by: RJG
6 Replies
Validation::Class::Backwards(3pm)			User Contributed Perl Documentation			 Validation::Class::Backwards(3pm)

NAME
Validation::Class::Backwards - Backwards-Compatibility Layer for Validation::Class VERSION
version 7.70 SYNOPSIS
package SomeClass; use Validation::Class; package main; my $class = SomeClass->new; ... 1; DESCRIPTION
Validation::Class::Backwards is responsible for providing deprecated functionality to the Validation::Class::Prototype layer whilst clearly remaining separate via namespacing. Note: The methods described here will eventually become obsolete and cease to exist. Please review the namespace occasionally and adjust your code accordingly. Using methods defined here will generate warnings unless you unset the $ENV{'VALIDATION_CLASS_BC_WARNING'} environment variable. METHODS
error DEPRECATING: The error method is used to set and/or retrieve errors encountered during validation. The error method with no parameters returns the error message object which is an arrayref of error messages stored at class-level. # set errors at the class-level return $self->error('this isnt cool', 'unknown somethingorother'); # set an error at the field-level, using the field ref (not field name) $self->error($field_object, "i am your error message"); # return all errors encountered/set as an arrayref my $all_errors = $self->error(); RECOMMENDED: # see Validation::Class::Errors # set errors at the class-level return $self->errors->add(...); # set an error at the field-level $self->fields->{$field_name}->{errors}->add(...); # return all errors encountered my $list = $self->errors->list; AUTHOR
Al Newkirk <anewkirk@ana.io> COPYRIGHT AND LICENSE
This software is copyright (c) 2011 by Al Newkirk. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. perl v5.14.2 2012-06-28 Validation::Class::Backwards(3pm)
All times are GMT -4. The time now is 08:39 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy