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
Install additional fonts ? vilius AIX 0 05-27-2008 01:12 AM
Additional book recommendations era I'm new to Unix. Which books should I read? 0 05-18-2008 07:52 AM
additional interfaces in XEN environment sap4ever Linux 0 03-03-2008 07:08 AM
Help with Additional Password Features rambo15 UNIX for Advanced & Expert Users 1 07-25-2005 09:44 AM
Additional character output negixx Shell Programming and Scripting 2 06-13-2005 06:18 PM

 
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
Prev Previous Post   Next Post Next
  #1 (permalink)  
Old 03-31-2006
guiguy guiguy is offline
Registered User
  
 

Join Date: Mar 2006
Posts: 13
sed Command - Need Additional Assistnce

Here is my data

I have a file in the format below with about 15 fields per each record. I have 2 records displayed below.

"1234","Andy ","Rich ","0001","123 Main Street ","Dallas ", "1"
"2345","Andrew ","Richter ","0002","234 First Ave ","Kirby ", " "

My Final output needs to be as follows

"1234","Andy","Rich","0001","123 Main Street","Dallas","1"
"2345","Andrew","Richter","0002","234 First Ave","Kirby"," "

I am using the following Sed command and it works excep it also deletes the space in the field and I need the last data element to stay like it is either a "1" or a " " (space).


sed -e 's/[ ]"/"/g' inputfile>outputfile...


what do I need to change in the sed command that I am using to get the result that I am looking for. The above is just the sample of the data, and it is not all data elements, there are quite a few additional fields but the last field is what I have in my data sample.

Thanks
 

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:03 AM.


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