10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hello to all,
I have the following text where columns are separated by spaces. I want to have the 3rd column separating
3 strings with 2 "_" in the format below:
LeftSring_CentralString_RightString
So, in 3rd column I want to replace all "_" with "-", except the first and last "_"
The... (5 Replies)
Discussion started by: Ophiuchus
5 Replies
2. Shell Programming and Scripting
Hi All,
I have a requirement to find and replace old date with new date value. Below is the scenario:
# In the input file, date is MM/DD/YYYY format
PREV_DTE=09/15/2013
I want to replace with 09/30/2013. It should look like
PREV_DTE=09/30/2013
I am using below sed command :... (4 Replies)
Discussion started by: rockygsd
4 Replies
3. Shell Programming and Scripting
Hello All,
I have file named filelist.txt
a.bteq.ctl
b.bteq.ctl
c.bteq.ctl
I want to replace the word bteq to tpt in this file.
I used this sed command
cat filelist.txt | sed 's/bteq/tpt/g' > filelist.txt
But this command deletes all records from the filelist.txt
Can... (2 Replies)
Discussion started by: nnani
2 Replies
4. Shell Programming and Scripting
Hi,
I have a requirement to search for a pattern in each line in a file and remove the in between words till the 3rd occurrence of double quote (").
Ex: CREATE TABLE "SCHEMANAME"."AMS_LTV_STATUS"
(Note: "SCHEMANAME" may changes for different schemas. Its not a fixed value)
I need to... (2 Replies)
Discussion started by: satyaatcgi
2 Replies
5. Shell Programming and Scripting
Hello.
I am using :
sed -i -e '/§name_script§/a#'"${MY_TAB11}"'# \
#'"${MY_TAB1}"'The Standard way'"${MY_TAB7}"'# \
#'"${MY_TAB1}"'==============='"${MY_TAB7}"'# \ ' "$CUR_FILE"
Is there a better way to define "MY_TAB7","MY_TAB11" in other way than :
MY_TAB1=$'\t'
MY_TAB2=${MY_TAB1}$'\t'... (2 Replies)
Discussion started by: jcdole
2 Replies
6. 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
7. Shell Programming and Scripting
cat input.txt
agsbdafgd
ertebrtreter
ahrbrwerg
The last character of a line that does not start with a would be changed to Z.
Final output:
agsbdafgd
ertebrtreteZ
ahrbrwerg
Can anyone post the sed command to do that? (2 Replies)
Discussion started by: cola
2 Replies
8. Shell Programming and Scripting
Hi All,
I don't know what I am doing wrong in the regex below.
I have the following string:
31000000010201005181121360000000100000000003000000YYY-YYY-YYY-20100518-104139.txt.YYY
I need to split it in parts:
- Group 1: 3100000001020100518112136
- Group 2: 000000010
- Group 3:... (0 Replies)
Discussion started by: felipe.vinturin
0 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