10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hello All
I am struck in the issue which I want to share with all of you.
What I am trying to do is For every line in a file I have to replace a particular character from the given character in a file
For Example
Suppose the data is
1111x2222
1111x2222
2222y3333
1111x2222
I... (4 Replies)
Discussion started by: adisky123
4 Replies
2. Shell Programming and Scripting
How can I replace the follong text including to number 7000?
cat tmp0.txt
Winston (UK) Wong
I would the 7000 to replace Winston (UK) Wong.
I fail with method below:
sed ' s /Winston\(UK\)Wong/7000 tmp0.txt' (1 Reply)
Discussion started by: vivien_chu
1 Replies
3. Shell Programming and Scripting
Hi all ,
I have to write a shell script that takes a number as input , like 123
and the output will be 6 ,i.e the output will be the sum of digits of the input.
I have an idea as follows,
echo "123"|fold -1|tr '\n' '+'|bc
But the problem is after " echo "123"|fold -1|tr '\n' '+' "... (5 Replies)
Discussion started by: M.Choudhury
5 Replies
4. Shell Programming and Scripting
I have a unicode character {Unicode: 0x1C} in my file and I need to replace it with a blank. How would a sed command look like?
cat file1 | sed "s/(//g;" > file2
Is X28 the right value for this Unicode character?? (4 Replies)
Discussion started by: Hangman2
4 Replies
5. Shell Programming and Scripting
I have the replace the pattern in the file , ); to );
Could someone please help me to get this command. (2 Replies)
Discussion started by: mohan.bit
2 Replies
6. Shell Programming and Scripting
I need to do the following:
text in the format of: ADDRESS=abcd123:1111
- abcd123:1111 is different on every system.
replace with: ADDRESS=localhost:2222
sed 's/ADDRESS=<What do I use here?>/ADDRESS=localhost:2222/g'
Everything I've tried ends up with:
... (3 Replies)
Discussion started by: toor13
3 Replies
7. Shell Programming and Scripting
My script is extracting data from SQl session, however sometimes the result contains one or multiple space after/before any numerical value.
e,g .
"123","1 34","1 3 45", "43 5"
How to remove these unwanted spaces..so that I can get the following result :
"123","134",1345","435" (1 Reply)
Discussion started by: mady135
1 Replies
8. Shell Programming and Scripting
Hi All,
Was wondering how I can do the following....
I have a String as follows
"ACCTRL000005022RRWDKKEEDKDD...."
This string can be in a file called tail.out or in a Variable called $VAR2
Now I have another variable called $VAR1="000004785" (9 bytes long), I need the content of... (5 Replies)
Discussion started by: mohullah
5 Replies
9. Shell Programming and Scripting
I have a text file and every line ends in
|^
|^^
|^^^
|^^^^
I need to use sed to make all lines end it
|^
regardless of the amount of carrots.
The code i was using is:
cat FILE | sed 's/\^\^\^/\^/g'
But then they threw that curveball at me. Also is there a way to... (2 Replies)
Discussion started by: insania
2 Replies
10. Shell Programming and Scripting
I want to change the first/or any character of a string to upper-case:
String:
test
Desired results:
Test or tEst or teSt or tesT
thanks (6 Replies)
Discussion started by: prkfriryce
6 Replies