Sponsored Content
Full Discussion: File validation
Top Forums Shell Programming and Scripting File validation Post 302746545 by Chubler_XL on Wednesday 19th of December 2012 03:18:09 PM
Old 12-19-2012
Best idea is to pass a variable into awk:

Code:
dil=2
i=`awk -F'|' -v fields=$dil 'NF != fields {print NR, $0} ' ${pinb_fldr}/${pfile}DAT | wc -l | awk '{print $1}'`
echo "number of records with failed delimiter count is $i"


or course awk can count the lines without using wc and another awk

Code:
dil=2
i=`awk -F'|' -v fields=$dil 'NF != fields {miss++} END{print miss}' ${pinb_fldr}/${pfile}DAT`

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

validation :file <filename>

My user is ftp a CSV file from window. There is possiblity to doing FTP through different mode. This file is then picked by another program, but I want to make sure the FTP file would be always ascii format, bu releasing a commaon File <file name> Can any one provide input , abut how to put a... (2 Replies)
Discussion started by: u263066
2 Replies

2. UNIX for Dummies Questions & Answers

File Validation

Hi All, I am new to UNIX scripting. I need to validate a file. I need to check whether the file has a header , detail records and footer. If all the file is good I need to create a status file with the status 'Y' else 'N'. I have pasted the an example of the file below: ... (5 Replies)
Discussion started by: kumar66
5 Replies

3. Shell Programming and Scripting

File name and format validation

Hi Gurus, I used unix long time back. I need help for writing a unix script which can be automated and execute every day on specific time. 1.) This is the actual functional requirement. Informatica should reject incoming files that have invalid filenames or file formats 2.) My File... (6 Replies)
Discussion started by: vsmeruga
6 Replies

4. UNIX for Dummies Questions & Answers

file name with timestamp validation

Hi , I am trying to write a shell script which will validate all .csv file names in a directory , my file name format is as below. CDR_SCAN_Report_YYYYMMDDHHMI.csv 1. I need to validate the name should start with CDR_SCAN_Report. 2. And the time stamp part is a valid time stamp,if it is... (1 Reply)
Discussion started by: shruthidwh
1 Replies

5. Shell Programming and Scripting

File Name Validation

Hi All, I am trying to validate the file name against the naming convention mentioned in configuration file. In the configuration file, the file name convention is mentioned as: Myfile_SQ<NN>_<NN>_YYYYMMDD_HHMMSS.xml The actual file received is Myfile_SQ10_30_20110423_073002.xml How do... (1 Reply)
Discussion started by: angshuman
1 Replies

6. Shell Programming and Scripting

Input validation of file

Hi, I'm trying to do input validation for a file. If the user fails to enter a file name, the script should prompt for the file name or exit. I'm using this script to integrate with a bigger script which does ftp of the files which are "read". #!/bin/ksh echo "enter a file name" if then... (16 Replies)
Discussion started by: sam_bd
16 Replies

7. Shell Programming and Scripting

File validation

Hello, File contains 1,3 and 5 are required columns. it's working use this command. awk -F\| '$1 && $3 && $5' test1.txt > test2.txt How can use this unix programming.while using runnign this scirpt,it's raising the error. awk: ^ syntax error #!/usr/bin/ksh `awk -F\| '$1 &&... (3 Replies)
Discussion started by: bammidi
3 Replies

8. Shell Programming and Scripting

XML file validation

Hi, i am new to unix script. i have two xml files. one is orderinfo.xml and another one is xsd file(EmailMessage.xml). we need to compare the both file for poper nodes exists are not. for example: <xsd:element name="EmailMessage"> tag in the EmailMessage.xml file(xsd sheet),this tag... (2 Replies)
Discussion started by: bmk
2 Replies

9. Shell Programming and Scripting

Unicode file validation

I don't want HTML_CONTENT,RICH_CONTENT,TEXT_CONTENT columns data in the file and reset of data we need to extract. Find the attached file. Need to extract date in between DI_UX_ROW_END tag. Can help me using unix command using AWK. Thanks, (2 Replies)
Discussion started by: bmk
2 Replies

10. UNIX for Dummies Questions & Answers

Validation before moving the File

Hi, Before moving the files from source directory to target directory I need to check if the files have these strings 'Error', 'Not Valid' ,' YTF-' or if the file is a zero byte file, if the file contains these strings or if it is a zero byte file i should log a entry in the log file and fail... (5 Replies)
Discussion started by: gaur.deepti
5 Replies
globus_gram_job_manager_rsl_validation_file(3)		      globus gram job manager		    globus_gram_job_manager_rsl_validation_file(3)

NAME
globus_gram_job_manager_rsl_validation_file - RSL Validation File Format The idea behind the RSL Validation file is to provide a mechanism for job manager scheduler interfaces to implement RSL extensions, while having the job manager still be able to decide whether a job request contains a valid RSL string. In addition to indicating what RSL attributes are valid, the RSL validation file contains information about when the RSL attribute may be used, it's default value, and the format of the attribute's value. File Format Comments The RSL validation file may contain comments. Comments are indicated in the file by a line beginning with the # character. Comments continue until end-of-line. Comments are discarded by the RSL Validation File parser. Example: # I am a comment. Ignore me. ValidationRecords The RSL validition file consists of a set of ValidationRecords. Each ValidationRecord consists of a number of ValidationProperties associated with a single RSL attribute. ValidationRecords are separated by a blank line in the RSL validation file. Validation Properties A ValidationProperty is defined in the RSL validation file by a PropertyName and a PropertyValue. The syntax of a validation property is simply the PropertyName followed by a colon character, followed by a PropertyValue. If a PropertyValue begins with a double-quote, then it may span multiple lines. Double-quote characters within a multiline PropertyValue must be escaped by a preceding backslash character. An unquoted PropertyValue ends at the first newline character. Example: Attribute: directory Description: 'Specifies the path of the directory the jobmanager will use as the default directory for the requested job.' Defined PropertyNames The following PropertyNames are understood by this version of the RSL validation file parser. Any unknown PropertyName will cause the ValidationProprty to be ignored by the parser. Attribute The name of the RSL parameter to which this record refers. Description A textual description of what the RSL parameter means. Default The default value of the RSL parameter if it is not found in the RSL. The default value is only used if the DefaultWhen value matches the current validation mode. Values A string containing whitespace-separated list of enumerated values which are valid for this RSL attribute. For example, for the 'dryrun' parameter, this may be 'yes no'. RequiredWhen Some subset of the 'when strings' (see below), indicating when the RSL parameter is required for the RSL to be valid. DefaultWhen Some subset of the 'when strings' (see below) indicating when then RSL's default value will be used if the RSL attribute is not present in the RSL. ValidWhen Some subset of the 'when strings' (see below) indicating when then RSL attribute may be used. 'When' Strings The set of when strings understood by the RSL validation file parser are GLOBUS_GRAM_JOB_SUBMIT The RSL attribute pertains to job submission. GLOBUS_GRAM_JOB_MANAGER_RESTART The RSL attribute pertains to job manager restart. GLOBUS_GRAM_JOB_MANAGER_STDIO_UPDATE The RSL attribute pertains to the STDIO_UPDATE signal. Version 13.33 Mon Apr 30 2012 globus_gram_job_manager_rsl_validation_file(3)
All times are GMT -4. The time now is 07:30 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy