Search Results

Search: Posts Made By: medium_linux
Forum: Programming 02-26-2011
3,698
Posted By kurumi
$ ruby -pne '$_.gsub!(/\d+px/,"40px") if...
$ ruby -pne '$_.gsub!(/\d+px/,"40px") if /^\s+height/ && !$_["-"]' file
height: 40px;
line-height: 1.5em;
height: 40px;
height: 40px;
height: 40px;
line-height: 17px;
Forum: Programming 02-26-2011
3,698
Posted By yinyuemi
for 1 sed -n '/^ [^-].*height/p' file1>file2 ...
for 1
sed -n '/^ [^-].*height/p' file1>file2
for 2
awk '/[^-]height/{sub(/[0-9]*px/,"40px")}1' file2
Forum: Programming 02-26-2011
3,698
Posted By durden_tyler
But your desired output does include words with...
But your desired output does include words with hyphen!
As can be seen here -



So do you want to display lines that have "-height" or not ?
Do the following:

(a) Post a sample input file....
Showing results 1 to 3 of 3

 
All times are GMT -4. The time now is 01:53 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy