10 More Discussions You Might Find Interesting
1. UNIX for Advanced & Expert Users
Hi All,
i can replace a perticular value in sentence using perl.
perl -pi -e 's/old/new/' sample.txt
but i am not able to replace whole string by perl.
file1 contains "jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=10.147.109.211)(PORT=1526))(CONNECT_DATA=(SID= MWDBD22)))". i... (3 Replies)
Discussion started by: arindam guha
3 Replies
2. Emergency UNIX and Linux Support
Hi,
i have input like this :
SS-ID VLAN MAC TIME IP RSSI MODE UAPSD BW GI WMOS DHCP IDENTITY
----- ---- --- ---- -- ---- ---- ----- -- -- ---- ---- --------
1-1 0 C4:46:19:75:C1:55 23m 192.168.5.253 ... (5 Replies)
Discussion started by: justbow
5 Replies
3. Programming
Hi,
I have 5 files as below
$ ll sam*
-rw-rw-rw- 1 sam ugroup 0 Mar 21 06:06 sam3
-rw-rw-rw- 1 sam ugroup 0 Apr 3 22:41 sam2
-rw-rw-rw- 1 sam ugroup 17335 Apr 10 06:07 sam1
-rw-rw-rw- 1 sam ugroup 5 Apr 10 07:53 sam5
-rw-rw-rw- 1 sam ugroup 661 Apr 10 08:16 sam4
I want to list out... (4 Replies)
Discussion started by: sam05121988
4 Replies
4. Shell Programming and Scripting
I need to read the contents of a file. Then I need to grep for a keyword and replace part of the grepped line based on the condition of previous and present line.
Example input file:
V {
port1 = P;
port2 = 0;
shift_port = P0; /* if next shift_port is P0 I need... (9 Replies)
Discussion started by: naveen@
9 Replies
5. Shell Programming and Scripting
Hi All,
If I have a line as following:
( MA "vertical" )
How can I convert it to as below:
( BC "horizontal" )
Thanks,
--Michael (6 Replies)
Discussion started by: mxn731
6 Replies
6. UNIX for Dummies Questions & Answers
Hi All,
I wanted to do following.
1) If file exit then open file for reading and check if my string is there then
i wanted to replace the entire line with that string + something else
then close the file.
2) If file does not exit then i need to open the file and write to it.
I am done with... (0 Replies)
Discussion started by: Tarun24
0 Replies
7. Shell Programming and Scripting
Dear All,
i want to search particular string and want to replance next line value.
following is the test file.
search string is
tmp,???
,10:1 "???" may contain any 3 character it should remain the same and next line replace with ,10:50
tmp,123 --- if match tmp,??? then... (3 Replies)
Discussion started by: arvindng
3 Replies
8. Shell Programming and Scripting
Hello,
I have a text file that i want to redirect into a new file , searching and replacing certain string during the opertaion.
This should be done using shell script , so it should not be interactive.
The script should get four parameters :
source file
target file
source string
target... (1 Reply)
Discussion started by: yoavbe
1 Replies
9. Shell Programming and Scripting
I have a file like this..
Maharastra Mumbai worli
Maharastra Mumbai navy
maharatra Pune
Maharastra Nagpur
Karnataka Bangalore
Karnataka Mysore
Karnataka Mangalore
Punjab Amritsar
punjab Jalandar
my expected outcome should be like this
Maharastra Mumbai worli
---------- ... (9 Replies)
Discussion started by: geeko
9 Replies
10. Shell Programming and Scripting
I have a perl function in my script that needs to replace an entire line in a file
sub changestate {
my $base = ();
my @base = ();
open(BASE, $file) || die("Could not open file!");
@base=<BASE>;
close (BASE);
foreach $base(@base)
{
if($base =~... (1 Reply)
Discussion started by: insania
1 Replies