10 More Discussions You Might Find Interesting
1. UNIX for Beginners Questions & Answers
I have the below string which i need to compare with a file and replace this string in the file which matches closely. Can anyone help me on this.
string(Scenario 1)- user::r--,user::ourfrd:r--
String(Scenario 2)- user::r--
File
****
# file: /local/Desktop/myfile
# owner: me
# group:... (6 Replies)
Discussion started by: sarathy_a35
6 Replies
2. Shell Programming and Scripting
Hi, I have a tab delimited text file like this one. I need to do a partial match of a particular cell and then replace matches with an empty cell. So here is a sample:
Smith FordMustang ChevroletCamaro
Miller FordFiesta
Jones KiaSorrento
Davis ChevroletCamaro
Johnson ToyotaHighlander
I... (4 Replies)
Discussion started by: mikey11415
4 Replies
3. Shell Programming and Scripting
Trying to combine strings that are a partial match to another in $1 (usually below it). If a match is found than the $2 value is added to the $2 value of the match and the $3 value is added to the $3 value of the match. I am not sure how to do this and need some expert help. Thank you :).
file
... (2 Replies)
Discussion started by: cmccabe
2 Replies
4. Shell Programming and Scripting
Hi Guys,
I need replace part of string in a file.
for example:
ABC=123
CDE=122
DEF=456
ABC=123
DED=333
ABC=123
I need replace the value after ABC=, highlighted in red. I want to get following result;
ABC=456
CDE=122
DEF=456
ABC=456
DED=333
ABC=456
Anybody can help me this.
... (8 Replies)
Discussion started by: ken6503
8 Replies
5. Shell Programming and Scripting
Hi all,
i've a string
$DIR=/u/user/NDE/TEST_LOGS/20110622_000005_TEST_11_HD_120/HD/TEST_11_HD_120/hd-12
i need to extract string from 2011.... i.e i need it as 20110622_000005_TEST_11_HD_120 as matched string, and in turn i need to split values 20110622_000005_TEST_11_HD_120 into two.... (6 Replies)
Discussion started by: asak
6 Replies
6. Shell Programming and Scripting
Hello, this is probably a simple request but I've been toying with it for a while.
I have a large list of devices and commands that were run with a script, now I have lines such as:
a-router-hostname-C#show ver
I want to print everything up to (and excluding) the # and everything after it... (3 Replies)
Discussion started by: ippy98
3 Replies
7. Shell Programming and Scripting
source "PUT 810 712 0001 ILC AK4 00 0 00 00"
It needs to be changed to "PUT,810,712,0001,ILC,AK4 00 0 00 00"
Thanks in advance. (6 Replies)
Discussion started by: janex
6 Replies
8. Shell Programming and Scripting
Hi All,
I have:
$d = "12.02222222222";
$d =~ s/(.*).(.*)/$1/e;
The output should be just 12.
Please guide me my expression wrong.
Thanks (5 Replies)
Discussion started by: jimmy_y
5 Replies
9. Shell Programming and Scripting
Hi Everyone,
I have:
$val="QQ3_1899_CD4".
The output will be:
1899.
I did $val =~ /(\d+)/g; the output is 318994, then i use substr to get those 1899. This is not efficient.
Is any simple way, like just one line can do? Thanks (1 Reply)
Discussion started by: jimmy_y
1 Replies
10. UNIX for Advanced & Expert Users
Id like to delete a line from a file using (preferably a single line unix command) if it contains a certain string pattern.
If line contains "abcdef" then delete that line.
Help greatly appreciated. (7 Replies)
Discussion started by: cronjob78
7 Replies