The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
validation required in unix u263066 UNIX for Dummies Questions & Answers 2 09-25-2008 03:37 AM
UNIX script Validation matchey Shell Programming and Scripting 1 05-07-2008 11:56 AM
How Can I Do Time Validation in UNIX mosammey UNIX for Dummies Questions & Answers 4 11-26-2007 12:02 PM
Time Validation in UNIX? mosammey Shell Programming and Scripting 1 11-21-2007 02:23 PM
validation :file <filename> u263066 Shell Programming and Scripting 2 09-26-2006 03:59 AM

 
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rating: Thread Rating: 1 votes, 5.00 average. Display Modes
Prev Previous Post   Next Post Next
  #1 (permalink)  
Old 10-23-2008
minnuverma minnuverma is offline
Registered User
  
 

Join Date: Oct 2008
Posts: 6
Unix File Validation! Help

Hi All,

I got a file with 3 fields delimited by hyphen "-". I have to validate & cleanse the data before i begine the processing

Requirements

1. No record should contain more than 2 delimiters
2. No record should even contain less than 2 delimiters
3. Any records that matches rule 1 & 2 should be captured to
bad_records.dat
4. Delete records satisfying rules 1 & 2 from original incoming data file


Sample Format

input.dat
COL1-COL2-COL3
scott-2000-10
tiger-1000-20
c-bill-1000-30
mike20-1000

so after the validation&cleansing process, the data should appear like below

input.dat
scott-2000-10
tiger-1000-20

bad_records.dat
c-bill-1000-30
mike20-1000

Please note i can't use perl progressive scanning. I need to achieve this via korn shell script


Thanks guys
 

Bookmarks

Tags
grep or, minnu, unix file validation

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 08:53 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0