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 > UNIX for Dummies Questions & Answers
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #1 (permalink)  
Old 06-20-2008
MrCarter MrCarter is offline
Registered User
  
 

Join Date: Jun 2008
Posts: 9
How do I read/find/replace fields in a csv datafile?

hello.

I'm somewhat a novice here so please be patient. My stumbling block when loading csvs into ORACLE tables is this:

I need to read a csv datafile, check several fields in each line, and if any of stated fields contain A ZERO only [instead of YYYYMONDD date field expected] then replace it with a null/blank character.

I had a go at:

cat <datafile> | awk ‘$5 == “0” { “ “ } END { print }';
cat <datafile> | awk ‘$8 == “0” { “ “ } END { print }'; ..etc..

..alas it didn't work..

all advice/comments very much appreciated

Steven.