Search Results

Search: Posts Made By: vedanta
2,333
Posted By vedanta
awk use to generate report
Hi ,
In a directory list of ddl files are stored in the given format above. Above is the sample ddl file. The ddl file name is same as that of table name ie email_notifications.ddl
I want to...
1,288
Posted By vedanta
Thanks for your reply. It should have been ...
Thanks for your reply. It should have been


unset counter
counter=15

Have made one more correction

date_from=$(date -d "$date_to +0 days" '+%Y%m%d')
to get file size for every 15 days of...
1,288
Posted By vedanta
I have made some correction. Please let me know...
I have made some correction. Please let me know if there is a better way to do it.



unset date_to
unset date_from
unset counter=15
date_to=$(date -d 2018-06-15 +"%Y%m%d")
todate=$(date...
1,288
Posted By vedanta
Date issue
How to compare two input date string?

What I am basically trying to get here is get file names in a directory for a particular date range.
I would like to get the file data growth over a certain...
5,226
Posted By vedanta
Multi threading in UNIX
Hi,

Can we apply multi threading in Unix. I am using bash shell.
We have a generic script to load the data to table based on file input. For each file there is an individual table to load.
...
489
Posted By vedanta
Use of sed
what is the significance of each attribute below in two lines

sed -e 's/.*\(201[8-9][0-9]\{4\}\).*/\1/g'
sed -e ':a' -e 'N' -e '$!ba' -e 's/\n/ /g'`




1st line - what I have understood...
813
Posted By vedanta
Thanks! I did not understand below print "rm...
Thanks!
I did not understand below
print "rm " FILENAME > "remove_old_files.sh"
813
Posted By vedanta
for i in *w*.txt; do mv -v "$i" $(echo "$i" | tr...
for i in *w*.txt; do mv -v "$i" $(echo "$i" | tr 'w' 'd'); done
something like this?
and using sed to replace the content?

Please use CODE tags as required by forum rules!
813
Posted By vedanta
File and file content string rename
We have around 1000 scripts in a specific folder like mcx001.txt, mcx002.txt, mcx999.txt, mce001.txt etc
We need to rename those files where 3rd character is "x" and should be replaced by "y".
So...
2,860
Posted By vedanta
Many thanks! One problem I am seeing here is...
Many thanks!
One problem I am seeing here is that awk also is reading the comment lines.
Is there a way to ignore all comment lines at the very beginning? Should I need to create a separate post...
2,860
Posted By vedanta
Hi, I want to pull all the files that have the...
Hi,
I want to pull all the files that have the pattern like the input file given. In a directory there are say 5000 files out of which 1000 files have the text starting with 'submit file'.
and from...
2,860
Posted By vedanta
I am running the program as a .sh script. ...
I am running the program as a .sh script.


#!/bin/ksh
awk ' NR==1 {
print "File | Jobname | node | pfile | metafile | tname | priority |...
2,860
Posted By vedanta
when I replaced *.sh by the line in your original...
when I replaced *.sh by the line in your original code

I am getting below error:

awk: cmd. line:37: fatal: can not open file 'awk' for reading ( no such file or directory )
2,860
Posted By vedanta
Hi, It does not work when I replaced the...
Hi,

It does not work when I replaced the *.sh by
awk '/^submit/{print FILENAME;nextfile}' *.sh
in the orginal solution you provided. It gives error can not open file awk
2,860
Posted By vedanta
Thanks Guys for the help. Is there a way to use...
Thanks Guys for the help.
Is there a way to use awk '/^submit/{print FILENAME;nextfile}' *.sh instead of *.sh with awk in the script above.
There can be different files with different pattern and...
2,860
Posted By vedanta
Extract information from file
In a particular directory, there can be 1000 files like below.

filename is job901.ksh
#!/bin/ksh
cront -x << EOJ
submit file=$PRODPATH/scripts/genReport.sh maxdelay=30
&node=xnode01
...
1,807
Posted By vedanta
Can the output have all filenames, even if...
Can the output have all filenames, even if nothing found with awk
1,807
Posted By vedanta
Can it be done using grep? thanks
Can it be done using grep? thanks
1,807
Posted By vedanta
Generate .csv/ xls file report
There can be thousand of .ksh in a specific directory where sql files are called from ksh.

Requirement is to loop through all the files content and generate a report like below:

Jobname ...
1,513
Posted By vedanta
Comm giving unexpected results
Hi
I am comparing two files with comm -13 < (sort acc11.txt) < (sort acc12.txt) > output.txt
purpose: Get non matching records which are in acc12 but not in acc11...
TI am getting WRONG output....
1
883
Posted By vedanta
Error
#!/usr/bin/ksh
cat /home/test/mail
export email=`cat /home/test/mails`
mailx -s "test---" ${email}
I am getting not found error

cat mails
amit@gmail.com
if i write below ,its working fine
...
3,444
Posted By vedanta
Remove 1st word and _ from string
var=abc_cde_def_ghi_678.txt

Expected output:
cde_def_ghi_678.txt

Is there a better way to achive this other than cut command?
Basically, I need to remove the 1st word and _ from the string.
...
839
Posted By vedanta
Thanks for your reply. Can not we use regular...
Thanks for your reply. Can not we use regular expression something like [fFnN] ?
839
Posted By vedanta
List files
PATTERN_SEARCH_LIST="FN201_X_*_"$file_date"*.txt"
for file_name in $PATTERN_SEARCH_LIST
do
print "file name:"$file_name
#add process logic here
done

How to...
1,486
Posted By vedanta
Thanks for the reply. I have not tested the code...
Thanks for the reply. I have not tested the code yet but when I tried below piece of code

VAR=COL2 VAL=1 sed -i "s/^${VAR}=.*/${VAR}=${VAL}/" test.txt>tmp
mv tmp test.txt
The last line is not...
Showing results 1 to 25 of 35

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