10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi,
Need to replace last field in a file(/etc/passwd) ,if first filed matches with particular username.
Scenario:
cat testfor1
deekshi:x:7082:7082::/home/deekshi:/bin/bash
harini1:x:7083:7083::/home/harini1:/bin/bash
Here,if first field contains "deekshi", then i should replace... (4 Replies)
Discussion started by: Sumanthsv
4 Replies
2. Shell Programming and Scripting
how to replace the 10th colum? Each line begins similarly, but they all ends variously.
Col1,Col2,Col3,Col4,Col5,Col6,Col7,Col8,Col9,Col10,Col11,Col12,Col13,Col14,Col15,Col16,Col17
2015/03/14 15:00:04,2015/03/14 15:00:04,0,Server05,Omega-God,Beta_G,101011247,1,1,24,7,0,,339083645,1,1,... (9 Replies)
Discussion started by: ooilinlove
9 Replies
3. UNIX for Dummies Questions & Answers
Hi All,
Seeking for your assistance on how to search and replace the last field/column. please see sample below:
inputfile1.csv
="8923523434",="543623534"="afd23535623",="100"="200"
="8923523431",="543623536"="afd23535626",="101"="201"... (3 Replies)
Discussion started by: poginiks
3 Replies
4. Shell Programming and Scripting
Hi all,
I have a requirement to replace a field with a character as per the length of the field.
Suppose i have a file where second field is of 20 character length. I want to replace second field with 20 stars (*). like ********************
As the field is not a fixed one, i want to do the... (2 Replies)
Discussion started by: gani_85
2 Replies
5. Shell Programming and Scripting
I have 2 files A.txt and B.txt
A.txt 3 fields and separate by a comma
some,thing,florida
any1,thing1,california
some2,thing2,dallas
just,fun,kansas
B.txt has 8 fields and separate by a comma
what,ever,florida-state,,,,,,
some,one,dallas_state,,,,,,
You will see 3rd fields are the... (5 Replies)
Discussion started by: sabercats
5 Replies
6. Shell Programming and Scripting
i have something like this,
cat filename.txt
hui this si s"dfgdfg" omeone ipaddress="10.19.123.104" wel hope this works
i want to replace only 10.19.123.104 with different ip say 10.19.123.103
i tried this
sed -i "s/'ipaddress'/'ipaddress=10.19.123.103'/g" filename.txt
... (1 Reply)
Discussion started by: vivek d r
1 Replies
7. Shell Programming and Scripting
Hi
I am using awk to replace the 4th feild of the input line. My code is below:
REP_LINE=$(echo $Line | awk -v var=$REPL_DT '{$4=var; print}')
It does replaces but all words/phrases after the 4th feild are erased. Is there a way to modify the 4th feild of the input line and to have all... (7 Replies)
Discussion started by: sugan
7 Replies
8. UNIX and Linux Applications
Hi All,
I need to replace the last 19 bytes of the following string
My_Org_Testing_20090102_231124.txt (Text_Date_Time.txt).
I would like to derive the current time using "date +%Y%m%d_%H%M%S.txt" and replace the last 19 bytes of the above string
I would appreciate if someone could... (3 Replies)
Discussion started by: rpk2008
3 Replies
9. Linux
Hi, I need to replace a field (field 5) in a csv file, based on the content of another field (field 2), something like this:
actual file:
field1, field2, filed3, field4, field5, field6
01,232,abb-pan,679,,pan
02,565,cdf-pan,683,,pan
the result should be:
... (4 Replies)
Discussion started by: pcboss
4 Replies
10. Shell Programming and Scripting
Hi Can any one tell me how to replace the 10th column in a file(comma delimted) with a new file with a single column. Can any one Help me out of the please as soon as possible as i am in a terribley hurry!!!!!!
Many THanks, (2 Replies)
Discussion started by: ahmedwaseem2000
2 Replies