Visit Our UNIX and Linux User Community

Search Results

Search: Posts Made By: duke0001
2,048
Posted By duke0001
RudiC: Sorry for not providing detailed...
RudiC:

Sorry for not providing detailed information. I will pay attention future.
Based on vgersh99's advice. I looked at directory settings. I found that my setting had problem. Since no data in...
2,048
Posted By duke0001
vgersh99: Thanks for your attention. I need...
vgersh99:

Thanks for your attention. I need to explain here. The code I posted here is part of whole script. The script will be run on local Solaris server to generate the rename files for SFTP...
2,048
Posted By duke0001
RudiC: Thanks for advice. I have tried that...
RudiC:

Thanks for advice. I have tried that and many other things such as taking off double quote, using single quote and so on. It all didn't work. This rename statement is to use to rename files...
2,048
Posted By duke0001
Echo For ... Loop output into a file
Hi, All:

I have one for ... loop code to generate a list of rename statement. However, echo the loop output on screen is OK. But store the echo output into a file is not working. So come here to...
3,301
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...
3,301
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...
3,301
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,
...
3,301
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...
3,301
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...
3,301
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...
3,301
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,...
3,301
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...
3,301
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 <=...
2,924
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.
2,924
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...
2,924
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....
2,924
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: ...
2,924
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...
1,923
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...
1,923
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...
1,923
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...
1,923
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',
...
3,570
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.
3,570
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...
839
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...
Showing results 1 to 25 of 192

 

Featured Tech Videos

All times are GMT -4. The time now is 03:03 AM.
Unix & Linux Forums Content Copyright 1993-2020. All Rights Reserved.
Privacy Policy