10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I have a file which contains timestamp and date in the second column. If the line contains one of the word then it need to be replace like below. Any help is appreciated.
File:
a smallint
b timestamp
c date
d varchar
O/P:
a smallint
... (1 Reply)
Discussion started by: JoshvaPeter
1 Replies
2. UNIX for Advanced & Expert Users
Hi,
I want to search for a specific word in file and replace whole line with new text.
e.g.
1) I have file with below lines
APP=ABCD 12/12/2012
DB=DDB 01/01/2013
I need perl command which will check for APP=$VAL and replace whole line with APP=$NEWVAL $NEWDT
Simlarly need a... (2 Replies)
Discussion started by: mgpatil31
2 Replies
3. Shell Programming and Scripting
Hi Everyone,
I am looking for a simple way for replacing all the files under a directory that use the server "xsgd1234dap" with "xsdr3423pap".
For Example:
In the Directory,
$pwd
/home/nick
$ grep -l "xsgd1234dap" *.sh | wc -l
119
I have "119" files that are still using... (5 Replies)
Discussion started by: filter
5 Replies
4. Shell Programming and Scripting
Hi,
I want to replace a word in a file which occurs after a particular word.
For example :
$cat file.txt
CASE
WHEN
AND c1 = 'I'
AND c2= '2'
THEN 1
WHEN
AND c1= 'I'
AND c2= '0'
THEN 2
So in this example i want to replace... (4 Replies)
Discussion started by: ashwin3086
4 Replies
5. Shell Programming and Scripting
Hello Unix Users,
I am very new to Unix so I am not sure how do I do the following.
I need a script such that when I type the following in the command prompt
> . scriptName.sh wordToBeReplaced DirectoryLocation
will find the word someword located in a somefile.xml in DirectoryLocation... (8 Replies)
Discussion started by: 5211171
8 Replies
6. Shell Programming and Scripting
Hi,
this belongs a little to my other post but only at the starting point.
With
find -name "*.htm*" i got a list like this:
./1999/01/file1.html
./1999/01/file2.html
./1999/02/file1.html
./2000/04/file1.html
./2000/04/file2.html
./2000/04/file3.html
./2000/file1.html... (2 Replies)
Discussion started by: Tonda
2 Replies
7. Shell Programming and Scripting
file.txt contains
abc :-X 1234 :-X fjhfkf :-X ffwerw :-X fdfgetw :-X hwfhe89 :-X
in the this file there are 6 occurance of -X
i want to replace only first 3 occurances of '-X' with 'XY'
and write back to same file. (4 Replies)
Discussion started by: nawazkhan77
4 Replies
8. Windows & DOS: Issues & Discussions
how do I replace a word in a file using DOS commands?? (1 Reply)
Discussion started by: sabithareddym
1 Replies
9. UNIX for Dummies Questions & Answers
Guys,
I need to replace a portion of the lines in the file depending on the word
in my file i have this content
use DBNAME
go
print "use DBNAME"
i want to replace the variable DBNAME with something else. But the catch is this line is not always "use DBNAME". Sometimes it can be like "use... (3 Replies)
Discussion started by: sasiharitha
3 Replies
10. Shell Programming and Scripting
Hi,
I have a Template file 'TL.body' which says as follows:
"There are no <FILENAME> files on the server. "
The missing file names are identified and stored in a variable.
For Eg: MISSFILE="abc.txt def.txt xyz.txt"
I want the values of MISSFILE variable to be replaced against... (2 Replies)
Discussion started by: brap45
2 Replies