File looks like
$1 $2 $3
Text Text2 *
Text Text4 Text3
I would like to search for *'s within a file and replace the with the text in the column next to it. While keeping the rest of the info… basicly replace the * logicaly with column 2.
Currently I am working with either sed or awk
awk : awk '{ if($3=*) {print$2}}' works… but I would like to keep $1,2 aswell
sed : sed -r 's/[*]//g' I can’t get reg expression to replace with $2 properly
Any quick help, tips or tricks?
Contents of
file.txt:One way using
awk:Results: