I tried running your code and realized that it prints out the output, rather than saving the file. How come when I do a
Quote:
> file.tmp
command, it doesn't create an output file?
---------- Post updated at 10:58 PM ---------- Previous update was at 10:29 PM ----------
Quote:
Originally Posted by jl487
I tried running your code and realized that it prints out the output, rather than saving the file. How come when I do a command, it doesn't create an output file?
nevermind.... made a dumb mistake. vgersh99 thanks for the help!
---------- Post updated at 11:46 PM ---------- Previous update was at 10:58 PM ----------
sorry for bringing back what I thought was a "dead thread"
I realized that some of the xml files has the following lines:
Therefore, both margin-left and margin-right would need to be changed. What I did was create the following bash file:
where jl1.awk is the following:
and jl2.awk is:
jl1.awk seems to work fine, but when I run jl2.awk, the margin-right information is deleted. Why is this?
Plzzzz, tell me some script about this...
What does this mean ?
sed '/^ */s///'
sed '/^/s// /'
and why it's diferent ???
sed '/ */s// /g' and sed 's/ */ /g'. It's all the same ???
Thanks you very much (2 Replies)
Is there any way we can achieve search & replace with awk?
I could achieve the same with sed in following way -
sed 's/A/B/g' file1 > file2
But the same regex if I try with using awk following way,
awk 's/A/B/g' file1 > file2
it gives me Syntax error. I strongly believe I am... (1 Reply)
Can I use search & replace in any variable?
Suppose I have one variable named var1 which holds value "abcabc" I need to search 'a' in var1 and want to replace with 'x' like 'xbcxbc'. Is it possible? Can you provide me an example?
Malay (3 Replies)
Hey, I want to have a C program which, for an existing file supplied by the command line argument (E.g. File1.txt) replaces all the occurrences of the words:
"We” or “we” by “I”
“a” by “the”
“A” by “The”.
Then print the replaced file. All other characters of the file are to be left... (1 Reply)
I have a file that has some accent characters in it when viewed in some text editors, but when viewed in vi they come in as ~R and ~U. I need to make a script to remove these characters from the file, but have been unsuccessful. I am not sure how sed or awk, or something similar is viewing them,... (8 Replies)
Hi ,
I ahve a text file which has several instances of the text such as
run_time: 09:30
I need to add double quotes before and after the time value
i.e: run_time: "09:30"
Any suggestions on how to go about the same (4 Replies)
Hi,
My problem is that I have to search a changing pattern and replace it with the wild card char "*"
i/p: 99_*_YYYYMMDD_SRC.txt.tar.gz
o/p: 99_*_*_SRC.txt.tar.gz
The problem is that YYYYMMDD pattern is not static. It could be YYYYMMDDHHMI or could be YYYYMMDDHHMISS.
Can... (10 Replies)
Hi all
Please can you help me with a script to check several files for the following string:
encoding=""and replace it with:
encoding="UTF-8"I did the following, :
#!/bin/sh
string1="encoding="""
string2="encoding="UTF-8"
sed 's/'"$string1"'/'"$string2"'/g'but does not work.
Please can... (18 Replies)
Hi All,
I want to perform a mathematical operation on column. Can anyone please help?
Here is the sample of operation to be performed:
123 996 100
123 996 200
123 996 200 2015-09-21
123 996 100
123 996 200
123 996 100
What I want is to multiple all values of column # 3 by 100 and... (3 Replies)
Hi Gurus,
I have two files. I want to read sessoin_name from the file1 and replace $Param4 & $Param5 in file2 with connection_name in specified in file1.
The file1 will have data in following format
File 1
session_name,connection_name
s_abcd,Listener_2
s_def,Listener_1
source file... (7 Replies)