Search Results

Search: Posts Made By: duke0001
712
Posted By duke0001
RudiC: I have tried different ways. it...
RudiC:

I have tried different ways. it didn't work. So I will take stupid way to do this work. I will pick up $OLDDATE and $NEWDATE two variables from database. Then:

/usr/xpg4/bin/sed...
712
Posted By duke0001
RudiC: Thanks. I debugged as this, this...
RudiC:

Thanks. I debugged as this, this time, sed found the specific MON and replace it with whole value of $NEWDATE. But the DD and YYYY are not searched and replaced. I put DD in search, then...
712
Posted By duke0001
RudiC: Yes. I missed a / and tested again....
RudiC:

Yes. I missed a / and tested again. The result is still not working. It seems that sed cannot find MON in lines. This part-s/\(JUN\|JUL\|AUG\) is not functioning. see output,
...
712
Posted By duke0001
RudiC: Thanks for new input. I tried and got...
RudiC:

Thanks for new input. I tried and got this output,

/home/oracle/>/usr/xpg4/bin/sed "s/\(JUN\|JUL\|AUG\)/$NEWDATE" test4.txt
sed: command garbled: s/\(JUN\|JUL\|AUG\)/01-OCT-2019

Now...
712
Posted By duke0001
RudiC: Thanks for suggestion, I tried. It...
RudiC:

Thanks for suggestion, I tried. It output the same result. I know the Date format in our SQL script is not configured well. But I cannot make change at this time. It will cause many...
712
Posted By duke0001
RudiC: To write months verbatim and escape,...
RudiC:

To write months verbatim and escape, it didn't work either. I need sed identify months because 4 quarters have 4 different begin date and 4 end date. Hard code will not work. I tried...
712
Posted By duke0001
vgersh99: Thanks for input, here is the...
vgersh99:

Thanks for input, here is the output

/home/oracle/> sed -e "s/[0-3][0-9]-($(locale abmon | tr 'a-z;' 'A-Z|'))-[12][09][0-9][0-9]/"'01-OCT-2019'"/" test4.txt
ep.begin_date,...
712
Posted By duke0001
RudiC: Thanks for your questions and advice....
RudiC:

Thanks for your questions and advice. My Unix is Solaris 10. It seems sed do not support EREs. Please see following output. As for date regex is concerned, this format was created by some...
712
Posted By duke0001
How to identify delimiter to find and replace a string with sed?
I need to find and replace a date format in a SQL script with sed. The original lines are like this:

ep.begin_date, ep.end_date, ep.facility_code,
AND ep.begin_date <=...
921
Posted By duke0001
Scrutinizer: I posted some feedback for your...
Scrutinizer:

I posted some feedback for your to review. Thanks for your advice and help.
921
Posted By duke0001
Scrutinizer: I used this SQL query to fetch...
Scrutinizer:

I used this SQL query to fetch business_day and Date_digits into shell variables jdate1 and jdate2. Then use sed to replace them. It worked well.
If using my SQL query, how it work...
921
Posted By duke0001
Scrutinizer: Thanks for advice. I have...
Scrutinizer:

Thanks for advice. I have tested with your input and command like this:
sed 's/[0-9]\{7\}/2019304/; s/[0-9]\{4\}\.[0-9]\{3\}/1910.304/' test_file1.txt
Then output is what I need....
921
Posted By duke0001
Hi, All; I also tested using sed to replace...
Hi, All;

I also tested using sed to replace the digits in the one line as:

sed 's/[0-9]\{7\}/2019304/' test_file1.txt, ---replacement is entered at this circumstance.

I got output as: ...
921
Posted By duke0001
Using sed or awk to replace digits in files
Hello;

I am not good at file and stream editing. I need to replace a few digits in two files. The lines in files looks like this:

Line in the first file, /dw300/data/obe/2019273.L800JR.1909.273...
912
Posted By duke0001
RudiC: Thanks a lot. Here # is delimiter. I...
RudiC:

Thanks a lot. Here # is delimiter. I thought the # is some extended expression and tried to find more information without success. Now, I learned from you. I will keep this explanation for...
912
Posted By duke0001
RudiC: Thanks for explanation. I still do...
RudiC:

Thanks for explanation. I still do not understand. man sed, only tell us 's/REGEXP/REPLACEMENT/FLAGS'.. In your command, 's#/#/text/#', text is REPLACEMENT. So 1st #, 2nd # and 3rd # stand...
912
Posted By duke0001
RudiC: I have tested. It works. your code...
RudiC:

I have tested. It works. your code can deal with all situation and insert new path text in the beginning of the all path. Thanks a lot. If you can give some explanation about "sed" options...
912
Posted By duke0001
How to use sed to insert character in the beginning of file path?
I need to manipulate one Database file on Solaris 11 in which contains more than 5000 lines of data file path like this:

'/data1/oradata/DBNAME/system01.dbf',
...
1,774
Posted By duke0001
RudiC, Scrutinizer: Thanks a lot to both of...
RudiC, Scrutinizer:

Thanks a lot to both of you. The explanation is clear and make me better understanding on these special characters. I will learn more.
1,774
Posted By duke0001
How to understand special character for line reading in bash shell?
I am still learning shell scripting. Recently I see a function for read configuration. But some of special character make me confused. I checked online to find answer. It was not successful. I post...
684
Posted By duke0001
Shell scripting syntax error in if then else
I have one bash shell script to execute table refreshment. At the bottom of script, I have one piece of code to check 'ORA-' error from log file, then send email to DBA or application people. But...
878
Posted By duke0001
appreciation
Scrutinizer:

Thank you so much for your advice. You helped me to understand this.
878
Posted By duke0001
Escape and command substitution in scripting
I have one question in shell script for escape "\" with command substitution "` `". I post there to seek help to understand how it works.

My original one piece of code in script like this: This...
2,168
Posted By duke0001
How to fix connection to Oracle database through shell script?
I have a question regarding how to connect to Oracle Database through shell script.

1. If I want call a stored procedure on Linux server as this, it works.

$sqlplus /nolog

SQL*Plus: Release...
1,317
Posted By duke0001
resolve the issue. The problem is the order of...
resolve the issue. The problem is the order of coding. I put rm $LOGFILE in front of echo $STARTTIME. Of course, the file has been rrmoved, then create again with other echo redirect info. This is...
Showing results 1 to 25 of 188

 

Featured Tech Videos

All times are GMT -4. The time now is 09:41 PM.
Unix & Linux Forums Content Copyright 1993-2019. All Rights Reserved.
Privacy Policy