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
Problems with cut scorpio Shell Programming and Scripting 6 04-28-2008 08:49 AM
RCP problems Daishi UNIX for Dummies Questions & Answers 0 09-10-2007 05:20 AM
Zip Problems chapmana UNIX for Dummies Questions & Answers 4 11-29-2006 07:02 AM
gcc problems AJA SUN Solaris 7 03-09-2004 10:44 AM
'make' problems (compliation problems?) xyyz UNIX for Advanced & Expert Users 5 11-05-2001 10:47 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 04-22-2009
jascas jascas is offline
Registered User
  
 

Join Date: Apr 2009
Posts: 13
Parsin Problems

Hi all
I have this line of code for parsing .properties but it does not work corectly. As you can see I want to put an "XxxX" at the end of each line that has an "=" in it and it must exclude those that have ".png".

sed -e '/=/ {/\.png/!s/,/XxxX,/}' -e '/=/{/\.png/!s/$/XxxX/}' "${name}" >"${RESULT}"

This is ok but it does not work correctly. When I run it it puts "XxxX" on a new line instead of the end of the line. Also I want to change it so it does NOT modify the line if it ends in a number character or ".gif"

Thanks for your help
- James
  #2 (permalink)  
Old 04-22-2009
dennis.jacob dennis.jacob is offline Forum Advisor  
dj -------
  
 

Join Date: Feb 2007
Location: Cochin/Singapore
Posts: 515
Try this:

Code:
sed '/png/d' filename | sed 's/\(.*\)=\(.*\)/&XXXX/'
  #3 (permalink)  
Old 04-22-2009
jascas jascas is offline
Registered User
  
 

Join Date: Apr 2009
Posts: 13
I can't use this because it deletes the lines that end in .png and it does not take into account lines that end in .gif or a number value.
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 12:59 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language translation by Google.
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