The UNIX and Linux Forums  


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 07:48 AM
awk and file parsing devtakh Shell Programming and Scripting 4 05-06-2008 12:13 PM
File Parsing jsusheel Shell Programming and Scripting 5 09-25-2007 11:25 AM
Need help in file validation by shell script srichakra Shell Programming and Scripting 1 07-19-2007 03:22 PM
validation :file <filename> u263066 Shell Programming and Scripting 2 09-26-2006 04:59 AM

Closed Thread
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 Rate Thread Display Modes
  #1 (permalink)  
Old 03-06-2008
dolo21taf dolo21taf is offline
Registered User
  
 

Join Date: Feb 2008
Posts: 6
CSV file parsing and validation

I have a CSV file that needs to through two seperate processes (in the end there will be 2 files (Dload.unl and Tload.unl and we'll say the input file name is mass.csv). I have a processfile() function that will call the process Dload funtion. In Dload I want to read mass.csv into Dload and then do the following:

1. remove the 6th element in the array (or the last column)
2.validate the format is mm/dd/yy
3.validate that elements 0-4 are NOT NULL
4.write @line to Dload.unl seperated by pipes (with a pipe at the end of the line)

In Tload I want to read mass.csv into Tload and then do the following:
1. Add 3 columns to the file with the following information in each column:
- @output[0] = 0
-@output[1] = Today's Date (in the format 2007-11-07 00:00:00)
-@output[2] = "A"
2.write @line to Dload.unl seperated by pipes (with a pipe at the end of the line)
Thanks in advance, I really appreciate it.

Here is an example of the input file:
0,2007,A,MassLd,7,106,212,314,81,y,

0,2008,B,MassLd,8,107,213,315,82,x,

0,2009,C,MassLd,9,108,214,316,83,z,

0,2006,D,MassLd,6,109,215,317,84,u,


If you need anything else just let me know or have any questions on it.
S
  #2 (permalink)  
Old 03-06-2008
fpmurphy's Avatar
fpmurphy fpmurphy is offline Forum Staff  
Moderator
  
 

Join Date: Dec 2003
Location: Florida
Posts: 1,934
Show us what you have writen so far and perhaps we can then help you
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 10:47 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