10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Greetings. I have a three column file, and there are some numbers in the second column that are <1. However I need all numbers to be positive, thus need to replace all those numbers with just one. I feel like there must be a simple way to use awk to find these numbers and sed to replace but can't... (5 Replies)
Discussion started by: Twinklefingers
5 Replies
2. Shell Programming and Scripting
File
1,2,33,C,B
3,5,66,K,R
1,2,33,H,M
3,5,66,M,C
6,9,66,J,F
I will use the below command to find and replace in sed, where I'm using variable to find pattern.
while read line
do
sed 's/$line/77/' file
done<inputfile
But here I need to find value in column 3 and... (26 Replies)
Discussion started by: Roozo
26 Replies
3. Shell Programming and Scripting
All,
I have thousands of lines in a file with following format
DATA=_ONE_XXX_YYY_CCC_HHHG_
DATA1=_GGG_JJJJ_HHH_UUU_JJJJ_HHHH_LLL_
DATA3=_MMM_GG_NN_QQQQ_FFF_III_
I want to replace _ with . by ignoring the first (=_) and last (_)
So that out put should looks like... (4 Replies)
Discussion started by: baluchen
4 Replies
4. Shell Programming and Scripting
Hello everyone,
I need to extract some information from a csv file and further need to do some algebraic calculations on those information and then to throw the result in a new file.
Here is a sample from my data.csv file;
Col1,Col2,Col3,Col4,Col5,Col6,Col7... (19 Replies)
Discussion started by: hayreter
19 Replies
5. Shell Programming and Scripting
I need to do a find and replace. I tried below logic but getting warnings Could you please help?
a=`echo "<!DOCTYPE aaaaa bbbbb \"sample.dtd\">"`
b="<!DOCTYPE aaaaa bbbbb \" /a/b/c/datain/d_k/sample.dtd \">"
echo $a | sed -e "s/$a/$b/" > c.txt
getting the following error
sed:... (1 Reply)
Discussion started by: kmanivan82
1 Replies
6. Shell Programming and Scripting
Hi Everyone,
I am new to this forum and new to sed/awk programming too !!
I need to find particular string in file1(text file) and replace it with a value from another text file(file2) the file2 has only one line and the value to be replaced with is in the second column.
file 1:
(assert (=... (21 Replies)
Discussion started by: paramad
21 Replies
7. Shell Programming and Scripting
Hello all
I have a file with a lot of records...Each one have a ID like this:
000000001 LDR L -----nam--2200217Ia-45e0
000000001 891
000000001 892
000000001 893
and so on
then you have the second record:
000000002 LDR L -----nam--2200208Ia-15e0
000000002 891
000000002... (5 Replies)
Discussion started by: ldiaz2106
5 Replies
8. Shell Programming and Scripting
hi,
i have file say email.temp looks like
Bell_BB 17
Bell_MONTHLY 888
SOLO_UNBEATABLE 721
and another file r3
Bell BB,Bell_BB
Bell,Bell_MONTHLY
SOLO,SOLO_UNBEATABLE
i want email.temp files $1 say Bell_BB should be replaced by r3 Bell BB and Bell_MONTHLY by... (2 Replies)
Discussion started by: raghavendra.cse
2 Replies
9. Shell Programming and Scripting
Hi this is my first time posting ever. I'm relatively new in using AWK/SED, I've been trying many a solution. I'm trying to replace the 59th column in a file where if I encounter '' then I would like to replace it with the word NULL.
example
0 , '' , '' , 0 , 195.538462
change it to
0... (5 Replies)
Discussion started by: gumal901
5 Replies
10. Shell Programming and Scripting
Hello Everybody,
I am doing something like this on Redhat Linux
h=`cut -d"." -f4 file1`
s=`cut -d"." -f4 file2`
sed "s/$h/$s/g" file3
but this is not working
but if giving constant value its working,
for ex. sed "s/93/$h/g" file3
help...
Thanks for looking into my question (2 Replies)
Discussion started by: arvind_aks15
2 Replies