Search Results

Search: Posts Made By: Viernes
9,208
Posted By Chubler_XL
For output1: awk '/;;WORD/ { print $2 } /...
For output1:

awk '/;;WORD/ { print $2 }
/ lex:/ {
sub(/.*:[+]/,"")
gsub("/[^+]*[+]", " + ")
sub("/[^+]*$","")
print }' infile

For output 2:

awk '/;;WORD/ {printf "%s%s",...
1,971
Posted By Scrutinizer
Another one: awk '{split($0,F); gsub(/_\+/,x);...
Another one:
awk '{split($0,F); gsub(/_\+/,x); for(i=2;i<=NF;i++) if($1==$i) $1=$1 OFS F[i]}NF=1' file
(will work in most awks, but not all)

awk '{s=$1; split($0,F); gsub(/_\+/,x);...
3,393
Posted By Don Cragun
OK, good. Here are a couple of ways to do it: ...
OK, good. Here are a couple of ways to do it:
sed '/^[^\/]*$/d;s|/[^+]*+|+|g;s|/.*$||g;s/^+//;s/+$//;s/+/ + /g' input_fileand
awk '
index($0, "/") { # for any line containing a "/"...
3,393
Posted By bartus11
Try: perl -nle 'print join " + ", map...
Try: perl -nle 'print join " + ", map {s/[\+\/]//g;$_} /\+.*?\//g' file
44,043
Posted By Ygor
This will remove blank lines and those which only...
This will remove blank lines and those which only contain spaces...

grep -v '^ *$' $files

If you wanted to use sed, then...

sed '/^ *$/d' $files
Showing results 1 to 5 of 5

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