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 of character separated lines in a file kolesunil UNIX for Dummies Questions & Answers 3 05-27-2008 06:48 AM
CSV file parsing and validation dolo21taf Shell Programming and Scripting 1 03-06-2008 06:15 AM
Need help in file validation by shell script srichakra Shell Programming and Scripting 1 07-19-2007 02:22 PM
insert filename into file using SED (or AWK) USER#5 Shell Programming and Scripting 2 08-06-2006 10:08 PM
Filename Validation F-1 UNIX for Advanced & Expert Users 2 05-02-2006 01:29 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 09-25-2006
u263066 u263066 is offline
Registered User
  
 

Join Date: Jul 2006
Posts: 66
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 validation means

if file return = ASCII
ok
otherwise
ret code=1
  #2 (permalink)  
Old 09-25-2006
Andrek Andrek is offline
Registered User
  
 

Join Date: Aug 2006
Posts: 122
Hi, On the UNIX end use the command "file" and then check the output against what you want and processed for the execution if it meets your test critia...
  #3 (permalink)  
Old 09-26-2006
Dhruva's Avatar
Dhruva Dhruva is offline
Registered User
  
 

Join Date: Mar 2006
Location: India
Posts: 255
Code:
file "$1" | /usr/xpg4/bin/grep -Fq ascii &&
          printf "%s is ascii.\n" "$1"
Sponsored Links
Closed Thread

Bookmarks

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 07:08 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