Search Results

Search: Posts Made By: dragon.1431
1,676
Posted By Chubler_XL
Match lines with description and only replace...
Match lines with description and only replace data values in 2nd item (This is closer to OPs original script):

awk -F\" 'NR==FNR&&/description/{a[$2]=$4;next}/description/{$4=a[$2]}NR!=FNR'...
1,676
Posted By yinyuemi
try: awk 'NR==FNR{a[$2]=$3;next}{$3=a[$2];print...
try: awk 'NR==FNR{a[$2]=$3;next}{$3=a[$2];print $0}' source tobe
3,445
Posted By rdcwayx
awk '$NF="|"$NF' infile
awk '$NF="|"$NF' infile
2,916
Posted By pravin27
Try this, awk -F"|" 'BEGIN{a["JAN"]="01" ...
Try this,

awk -F"|" 'BEGIN{a["JAN"]="01"
a["FEB"]="02"
a["MAR"]="03"
a["APR"]="04"
a["MAY"]="05"
a["JUN"]="06"
a["JUL"]="07"
a["AUG"]="08"
a["SEP"]="09"
a["OCT"]="10"
a["NOV"]="11"...
7,962
Posted By Scrutinizer
@dragon
sed '/^$/d' infile will delete empty lines, but not whitespace-only lines..
1,261
Posted By Scrutinizer
sed 's/=[^,]*/=0/g' infile
sed 's/=[^,]*/=0/g' infile
4,913
Posted By Scrutinizer
GNU sed: sed 's/ /|/g;s/|/ /12g' infile
GNU sed:
sed 's/ /|/g;s/|/ /12g' infile
3,042
Posted By rdcwayx
awk 'NR==FNR{a[$1];next} {for (i in a) {if ($0~i)...
awk 'NR==FNR{a[$1];next} {for (i in a) {if ($0~i) sub(i,i "_EDITED")}}1' Read.txt input.txt
3,042
Posted By Franklin52
Or: b=_EDITED while read i do sed...
Or:
b=_EDITED

while read i
do
sed "s!$i!$i$b!" input.txt > temp
mv temp input.txt
done < read.txt

If your sed version supports the -i option:
b=_EDITED

while read i
do
sed -i...
3,042
Posted By pravin27
try this, #!/bin/sh cp input.txt...
try this,


#!/bin/sh

cp input.txt temp_forum.txt
a=`cat read.txt`

for i in $a
do
if [ -f temp1_forum.txt ]
then
cp temp1_forum.txt temp_forum.txt
fi
b=_EDITED
c=$(echo $i | sed...
1,903
Posted By bartus11
It is not working as you expected, because regexp...
It is not working as you expected, because regexp can also match from middle of the line to the end. So it matches like this:11111112
111111112
To match only from the beggining of the line use:grep...
2,801
Posted By Scott
Hi. Your description could be considered...
Hi.

Your description could be considered slightly ambiguous, but:


$ egrep '^-[0-9][a-z]+[0-9]-$' file1
-1xyz1-
-2ab1-
22,010
Posted By danmero
awk -F\" -v dir="dir1/kernel" '$2~dir{print $4}'...
awk -F\" -v dir="dir1/kernel" '$2~dir{print $4}' file
If is not what you want , please post a sample of your List file, xml file and desired output base on example.
2,209
Posted By alister
I believe .svn are hidden directories used by...
I believe .svn are hidden directories used by subversion, not files. If so, rm without -rf won't remove them. Also, if they are directories, since they're going to be nuked, it's best to exclude...
2,209
Posted By durden_tyler
Something like this ? $ $ $ # show...
Something like this ?


$
$
$ # show the entire file hierarchy from the root directory "Project_Src"
$ find ./Project_Src -name "*"
./Project_Src
./Project_Src/x1.svn
./Project_Src/Dir_B...
Showing results 1 to 15 of 15

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