Search Results

Search: Posts Made By: Prasannag87
992
Posted By Prasannag87
Strip file based on pattern
Hi,

I am stripping the below file based on a pattern:

**Starts**02-MAY-2017 03:48:13
**Ends**02-MAY-2017 03:48:13
+---------------------------------------------------------------------------+...
1,123
Posted By Prasannag87
Thanks: Now I have done it in 2 steps: ...
Thanks: Now I have done it in 2 steps:

TO_DIR=${FROM_DIR/"out/o"/"log/l"}
TO_DIR=${TO_DIR/".out"/".req"}
Can it be done in a simpler way?
1,123
Posted By Prasannag87
Hi RudiC, I tried with echo...
Hi RudiC,

I tried with echo ${FROM_DIR//out/log}
But I cant put echo ${FROM_DIR/out/o/log/l} as it is not working

My search string as well as replace string has a / in between
1,123
Posted By Prasannag87
Find and replace
Hi,

I have a variable which holds the below value:

echo $FROM_DIR
/fsg/fgldevu/fs_ne/inst/FGLDEVU_01/logs/appl/conc/out/o14946708.out

I want to change the value in the variable as below:...
956
Posted By Prasannag87
File splitting
Hi,

I have the below file which I need to split:

> cat file.dat
00000201703300129STK00293...
12,838
Posted By Prasannag87
Did you tried spool...
Did you tried spool /home/appusr/scripts/${dateString}_batchtest3.log
2,852
Posted By Prasannag87
Thanks!! YrDoy=`date '+%Y%j'` works perfectly...
Thanks!!
YrDoy=`date '+%Y%j'` works perfectly for me!!
2,852
Posted By Prasannag87
Thanks a lot!! Actually, I need to derive a...
Thanks a lot!!
Actually, I need to derive a filename from it.

${FILE_NAME_WO_EXTN}_${year}${doy}.ZIP. Can you please help me how can I use it here
2,852
Posted By Prasannag87
Working with let command
Hi,

I need to find out the day of the year and it always needs to be 3 digits:


#!/bin/ksh
doy=`date '+%j'`
let doy=$doy-1
echo doy


Output is 36, but I need it to print as 036
...
1,605
Posted By Prasannag87
I got it: myarray=`for file in *.txt; do awk...
I got it:

myarray=`for file in *.txt; do awk -F'|' '$1=="\"HD\"" {gsub(/"/,"",$3); print FILENAME, $3;exit}' ${file}; done | sort -k2 | awk '{print $1}'`
for i in ${myarray[@]}
do
echo $i...
1,605
Posted By Prasannag87
Thanks, It gives below output: file2.txt...
Thanks, It gives below output:


file2.txt 0000000018
file1.txt 0000000019


So I just taking the first field alone:
for file in *.txt; do awk -F'|' '$1=="\"HD\"" {gsub(/"/,"",$3); print...
7,875
Posted By Prasannag87
This forum is not the right place to ask about...
This forum is not the right place to ask about Oracle concurrent programs. Yet, below is the solution for it.

There are no defined exit commands to return a warning status. However, it can be done...
1,605
Posted By Prasannag87
List the files after sorting based on file content
Hi,

I have two pipe separated files as below:

head -3 file1.txt
"HD"|"Nov 11 2016 4:08AM"|"0000000018"
"DT"|"240350264"|"56432"
"DT"|"240350264"|"56432"

head -3 file2.txt
"HD"|"Nov 15...
1,605
Posted By Prasannag87
awk comma seperated value within double quote
Hi,

I have a data file separated by comma, data enclosed by ""

head file.txt

"HD","Sep 13 2016 1:05AM","0001"
"DT","273093045","192534"
"DT","273097637","192534"
..

I want to get the...
10,516
Posted By Prasannag87
Thank you. It works now: find...
Thank you. It works now:

find "$INBOUND_PATH" \! -path "$INBOUND_PATH" -prune -type f -size 0 -exec sh -c 'for i do mv "$i" "'$ARCHIVAL_PATH'"; done' sh {} +
10,516
Posted By Prasannag87
find "$INBOUND_PATH" ! -name . lists me all the...
find "$INBOUND_PATH" ! -name . lists me all the files and current directory.
/home/pganesan/crypt
/home/pganesan/crypt/file1.txt
/home/pganesan/crypt/file2.txt
/home/pganesan/crypt/file_file.txt...
10,516
Posted By Prasannag87
Can this be done without
Can this be done without
10,516
Posted By Prasannag87
RudiC, I am now sure how to prepend source...
RudiC,

I am now sure how to prepend source file. Please help on that.

Chakrapani,

I didnt went for find since the archival path is in a subfolder and it will picks up those files as well....
10,516
Posted By Prasannag87
Move zero byte files
Hi,

I have a requirement to move zero byte files to an archive folder. I have the below script and it works fine if I run it from where the file is present. But when I run the script from...
24,408
Posted By Prasannag87
Thanks! Works perfectly!!
Thanks! Works perfectly!!
24,408
Posted By Prasannag87
Wget - working in browser but cannot download from wget
Hi,

I need to download a zip file from my the below US govt link.

https://www.sam.gov/SAMPortal/extractfiledownload?role=WW&version=SAM&filename=SAM_PUBLIC_MONTHLY_20160207.ZIP

I only have...
5,276
Posted By Prasannag87
Echo with cat command
Hi,

I need to send an email in the below format:

Hi All,

body description on 12-Dec-2014

<a html table, which is there in Result.txt file>

I am using the below command


{
echo "Hi...
1,720
Posted By Prasannag87
Ssh to get files from server A and zip in server B
Hi,

I have read & write access in Unix box A and read access in Unix box B.
I want a folder to be zipped from box B and sftp-ed in box A.

Is there a remote scripting to achieve this?
47,396
Posted By Prasannag87
Check if the SSL certificate is valid. It may...
Check if the SSL certificate is valid. It may have got end-dated
2,864
Posted By Prasannag87
Can somebody kindly help on this?
Can somebody kindly help on this?
Showing results 1 to 25 of 28

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