Search Results

Search: Posts Made By: mvijayv
1,478
Posted By mvijayv
Quick and dirty .. Assuming ur input is in a...
Quick and dirty ..
Assuming ur input is in a file called t1
Paste the below in a file
#!/bin/ksh
sort -n t1|grep . > t2.tmp
maxval=`tail -1 t2.tmp`
count=0
endv=$maxval
let...
3,316
Posted By mvijayv
Thanks Alister. Missed that piece .. Yup dos2unix...
Thanks Alister. Missed that piece .. Yup dos2unix doesn't merge the lines.
3,316
Posted By mvijayv
I had this issue with files that were ftp-ed from...
I had this issue with files that were ftp-ed from windows to unix .. using the dos2unix command cleans it up pretty well. Try it. I used it in a script to clean up data files before loading into the...
5,369
Posted By mvijayv
Thanks Alister .. dont know what started me off...
Thanks Alister .. dont know what started me off with that approach a long time ago .. but never too late to get over a bad habit ... Good info, Thanks!
5,369
Posted By mvijayv
cd to the directory that holds the files ...
cd to the directory that holds the files


rm mvcmds.sh
for filename in `ls -1|grep ^fK`
do
NewStr="eStroop_"
OldStr=`echo $filename|awk -F"." '{print substr($1,length($1) -2, length($1))}'`...
9,529
Posted By mvijayv
JustDate=`echo $JustFileName|awk -F"." '{print...
JustDate=`echo $JustFileName|awk -F"." '{print $1}'|awk '{print substr($1,length($1)-3,length($1))substr($1,length($1)-5,length($1)-10)substr($1,length($1)-7,length
($1)-10)}'`

This should give...
9,529
Posted By mvijayv
extracting the date from filename
Try this ..
CompletePath="/dprod/informatica/Fuentes/CRED20102009.csv"
JustFileName=`basename $CompletePath`
JustDate=`echo $JustFileName|awk -F"." '{print $1}'|awk '{print substr($1,length($1)-7,...
Forum: Solaris 11-12-2010
4,088
Posted By mvijayv
Hi Rocky1954, Are you looking to find a...
Hi Rocky1954,
Are you looking to find a unique list of hostnames from the file?
if so use the below code.
Assume the file containing that output is called sample.txt
awk -F"=" '{print $7}'...
1,848
Posted By mvijayv
This works for me ... $echo "text * text" ...
This works for me ...

$echo "text * text"
text * text

$echo "text * text"|sed 's/\*/\\052/g'
text \052 text

Hope this helps ...
Vj
5,121
Posted By mvijayv
Could you paste some sample lines from the input...
Could you paste some sample lines from the input file as well ...
2,278
Posted By mvijayv
easiest way without too much of code change would...
easiest way without too much of code change would be :

uuencode PurgeArchiveDir.out PurgeArchiveDir.out|mailx -s "`date +%m/%d/%Y %T` $P: The Purge Routine Has Started." $EMAIL

This would put...
4,201
Posted By mvijayv
x=`who am i` opt=`echo ${x} | cut -f1 -d' '` ...
x=`who am i`
opt=`echo ${x} | cut -f1 -d' '`
df -d > deljil.txt
cp deljil.txt temp.txt
while read line
do
#sed '/'"$line"'/d' deljil.txt > deljil99.txt
egrep -v "$line" temp.txt > temp2.txt...
4,201
Posted By mvijayv
The first issue here is that sed works on the...
The first issue here is that sed works on the whole deljil.txt file everytime for each new value of $line. In effect each execution does works again on previously eliminated lines.
I think the...
4,201
Posted By mvijayv
can you paste same sample lines from unix.txt...
can you paste same sample lines from unix.txt...
58,158
Posted By mvijayv
got it .... $! gives the child pid ..... ...
got it ....
$! gives the child pid .....

nohup /start/script.ksh 1>/dev/null 2>&1
print $! > .pid

nohup /start/script2.ksh 1>/dev/null 2>&1
print $! >> .pid


Vj
58,158
Posted By mvijayv
$$ gives you the pid of the current shell that is...
$$ gives you the pid of the current shell that is why it is giving you the pid of the script or session that is calling the nohup statement. you need to place the print $$ within script.ksh and...
1,247
Posted By mvijayv
Just a couple of tweaks ... the below works .. ...
Just a couple of tweaks ... the below works ..

#!/bin/ksh
set -x
cd .

if [ -f tempdspmq.txt.* ];then
rm tempdspmq.txt.*
echo " just removed file"
fi

echo "I am here" > tempdspmq.txt.$$
2,637
Posted By mvijayv
Which flavour of Unix is it in ..? The sed...
Which flavour of Unix is it in ..?

The sed command sort of fails to accept the $cod as a variable. Try single quotes as below:

sed "s/CODEVENTID/${cod}/" c.ctl

replace with

sed...
2,954
Posted By mvijayv
"set" with spaces might not work .... just use...
"set" with spaces might not work .... just use the below:

num=100
cat filename|grep xxx| tail -$num


Paste below in a file called "q"

#!/bin/ksh
num=$1
cat filename|grep xxx| tail -$num...
11,249
Posted By mvijayv
Thanks Fazliturk ... I am going to be...
Thanks Fazliturk ...
I am going to be trying this pretty soon ... Will let you know how it goes ... - thanks again ...
4,488
Posted By mvijayv
instead of using a zgrep ...try using a zcat as...
instead of using a zgrep ...try using a zcat as below
DIRECTORY=<Location where the files are located>
NEWDIR=<Desination folder>
for file in `ls -1 $DIRECTORY/*.Z`
do
LC=`zcat $file |head...
11,249
Posted By mvijayv
12123|12345678 42142|23442253 52315|32250205 ...
12123|12345678
42142|23442253
52315|32250205
....
....
...
....
....
around 50 million

Now I want to at random choose records and change the value of the second column

For example if I...
11,249
Posted By mvijayv
Hi ilan, Thanks for taking this up ... I...
Hi ilan,
Thanks for taking this up ... I have the first piece figured out ... I can generate a random number using a small perl script that I downloaded of the net ... but I have a problem with...
11,249
Posted By mvijayv
Edit a large file in place
:confused:Folks,
I have a file with 50 million records having 2 columns. I have to do the below:
1. Generate some random numbers of a fixed length.
2. Replace the second column of randomly...
Showing results 1 to 24 of 24

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