Search Results

Search: Posts Made By: rajeeb_d
6,740
Posted By rajeeb_d
To write a script to test anybody would need a...
To write a script to test anybody would need a small set of data to test. The files you have are so huge.

But any way try this.
#!/usr/bin/perl

open(DF,"ProfileNames.csv") or die "$!\n";
...
2,646
Posted By rajeeb_d
I do not want the shell to prompt me to enter...
I do not want the shell to prompt me to enter something at the input. I want the hardcoded variables to be passed within the shell. Is that possible? I thought there was some way to collect...
2,646
Posted By rajeeb_d
Vgresh99 In my post 'rateupd' is the...
Vgresh99

In my post 'rateupd' is the executable that is being run.

I want to wrap it in a shell script where I can pass 'rateupd' the varibles which it reads from the input.

Since the...
2,646
Posted By rajeeb_d
I need help to run this utility from a shell script
I need some help to run this executable from within a shell script.

The Script is run the following way at the command prompt.

$rateupd
Main Menu --Standard Output
----------- --Standard...
2,951
Posted By rajeeb_d
Just an idea
Why don't you split the file into small files of 1GB each. Then use Pederarbo's awk script to go through each one of the split files. And Awk being a stream editor there can be nothing faster to work...
21,999
Posted By rajeeb_d
ftp service
To ftp from UNIX environment to your local machine you need a ftp server running on you PC to service the incoming requests. Once you have that then try this test.
Then try

ftp <IP address of...
2,017
Posted By rajeeb_d
Try this
if [ `echo $1 | grep -c -i [a-z\ \*\\\//\$?]` -eq 1 ];then
echo "Is not number"
else
echo "Is number"
fi
3,930
Posted By rajeeb_d
Try this
awk -v x=4 '{printf("%s",$0);if(NF < x) for(i=NF;i<x;i++) printf("%s","\t"); printf("%s","\n")}'

x=4 is the number of fields you want to have.
6,549
Posted By rajeeb_d
Try this
awk 'NR > 1 {print l} {l=$0} END {sub(/,$/,"",l);print l}' <filename>
6,549
Posted By rajeeb_d
Try this
awk 'substr($0,length($0)) == "," {print substr($0,1,length($0)-1) substr($0,length($0)) != "," {print $0}' <filename>
5,620
Posted By rajeeb_d
Try this
If you have got records in a.txt you could do this. Remember a.txt has to be in the directory where this script is situated or else put the path before the file name a.txt.

# FCP_USERNAME=`echo $*...
1,863
Posted By rajeeb_d
Try this
If you are using an oracle Database then you can use this. Or else you have to use the executable that could execute the peice where this peice of code uses "sqlplus".

The following code should be...
56,941
Posted By rajeeb_d
Try this
If I get you right then this would work.

Create a wrapper shell script for your shell. in which export your vairables with the values before calling your shell script

For example you shell...
7,331
Posted By rajeeb_d
Try this
awk '{gsub(/@@;@@/,",");gsub(/@@\^@@/,"\n");printf("%s\n",$0)}' <filename>
22,296
Posted By rajeeb_d
Try this
list=`sqlplus -s $user/$pwd@$dbms<<EOF
WHENEVER SQLERROR EXIT FAILURE
set pagesize 0 feedback off verify off heading off echo off

select * from control_tbl
where src_nm=$3
and extrct_nm=$4;...
5,474
Posted By rajeeb_d
Try this
Put this code in a shell script
For eg. test_script.sh

file1=$1
file2=$2

while read a b c
do
v1=$a$b
lp="$a $b $c"
while read x y z
do
v2=$x$y
if [ $v1 = $v2 ]
...
5,474
Posted By rajeeb_d
I missed something in my last post try this
awk 'FNR == NR {a[$1]=$1 $2;b[$1]=$0;next} $1 in a {print b[$1], $3}' file1 file2
5,474
Posted By rajeeb_d
I hope this helps
awk 'FNR == NR {a[$1]=$1 $2;b[$1]=$0;next} {print b[$1], $3}' file1 file2
6,333
Posted By rajeeb_d
Just an idea
Put your job in a loop inside a shell script. Trap your error of your perl script in the loop. Put this shell script on cron.
1,703
Posted By rajeeb_d
Try this
ls -1 | awk '/testing{1,}/'
3,057
Posted By rajeeb_d
Try this
awk 'BEGIN{x="";i=0} NR == 1 {x=$1;y=$0} NR > 1 && x == $1 {printf("%s /// %s\n",y,$2);i=NR+1} NR == i {x=$1;y=$0} NR > i && x != $1 {printf("%s\n",y);x=$1;y=$0} END {printf("%s\n",y);}'
9,229
Posted By rajeeb_d
Examples
Could you give an example of the string and how you want it to look finally.
4,657
Posted By rajeeb_d
Try this
awk -F "," '{for(i=1;i<=NF;i++) if(i!=2 && i!=4 && i!=6 && i!=8) if(i<NF) printf("%s,",$i); else printf("%s%s",$i,"\n");}' <filename>
5,176
Posted By rajeeb_d
Try this
Use fold

For eg:
For specifying number of columns.
fold -w 587 <filename>

For specifying number of bytes.
fold -b 587 <filename>

Remember...
2,726
Posted By rajeeb_d
My mistake! The last line in the last reply was...
My mistake!
The last line in the last reply was wrong.

ALINES=$(cat AFILE | wc -l)
BFIRST=$(head -1 BFILE)
BFIRST=`echo $BFRIST | cut -d "'" -f 2`
then BFIRST will have 9
Showing results 1 to 25 of 37

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