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
Replacing characters in csv file finwhiz UNIX for Dummies Questions & Answers 1 03-31-2008 06:25 AM
replacing the characters in a file trichyselva UNIX for Dummies Questions & Answers 2 01-03-2008 08:02 AM
replacing characters palmer18 UNIX for Dummies Questions & Answers 3 08-20-2007 10:58 AM
Replacing characters in file with line break johnemb Shell Programming and Scripting 10 04-26-2007 08:38 AM
replacing few characters in a file purnakarthik UNIX for Dummies Questions & Answers 1 01-25-2007 05:17 PM

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 05-17-2007
vgersh99's Avatar
vgersh99 vgersh99 is online now Forum Staff  
Moderator
  
 

Join Date: Feb 2005
Location: Boston, MA
Posts: 5,131
Quote:
Originally Posted by Shell_Life
Nelson,
Per my previous reply, your sample led me to believe the following:
1) Every non-numeric field would be surrounded by double quotes.
except for "william".
2) Every numeric field would not be surrounded by double quotes.
If the specs give reason to question, no final solution will be found.
Shell,
this is a typical CSV conversion task - you cannot make any assumptions of what type of FIELD you're dealing with.
The only assumptions you can make are:
  1. This is a CSV-type file with ',' as a field separator
  2. There can be embedded ',' characters (plural) in any field
  3. some fields might be quoted with double-quotes
  #2 (permalink)  
Old 05-17-2007
nelson553011 nelson553011 is offline
Registered User
  
 

Join Date: Sep 2004
Location: Minnesota
Posts: 13
Thanks and Sorry

Sorry Shell, I tried to come up with every situation in my head, but missed that one scenario. I'm trying to come up with a solution without having an actual test file from my customer yet, trying to be proactive.

Also, that last reply using nawk worked great. Thanks for all your help.
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 09:36 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