Search Results

Search: Posts Made By: kshelluser
6,210
Posted By kshelluser
Thanks anbu23!
Thanks anbu23!
6,210
Posted By kshelluser
#if [ -z $1 ] ; then echo 'Assuming LIVE...
#if [ -z $1 ] ; then
echo 'Assuming LIVE database '
export db='LIVE'
else
export db=$1
echo "Running against $db database"
fi

ORACLE_SID=$db

#collect file from inputf folder
cd...
6,210
Posted By kshelluser
It does, if I do: awk '/^0/ { print...
It does, if I do:

awk '/^0/ { print "AA"substr($0,10,6)"00"}' $filename > TEST_FILE

all works fine, however I need to process files with two different names in a slightly different manner,...
6,210
Posted By kshelluser
have tried awk '/^0/ && FILENAME ~ /^AA/ {...
have tried

awk '/^0/ && FILENAME ~ /^AA/ { print "AA"substr($0,10,6)"00"}' $filename > TEST_FILE

however there is nothing being printed out to the TEST_FILE even though the file I'm...
6,210
Posted By kshelluser
Should it be: awk '/^0/ && $filename ~ /^AA/...
Should it be:

awk '/^0/ && $filename ~ /^AA/ { print "AA"substr($0,10,6)"00"}' $filename > TEST_FILE
awk '/^0/ && $filename ~ /^XX/ { print "XX"substr($0,10,6)"00"}' $filename >> TEST_FILE
...
6,210
Posted By kshelluser
Should it be: awk '/^0/ && $filename ~ /^AA/...
Should it be:

awk '/^0/ && $filename ~ /^AA/ { print "AA"substr($0,10,6)"00"}' $filename > TEST_FILE
awk '/^0/ && $filename ~ /^XX/ { print "AA"substr($0,10,6)"00"}' $filename >> TEST_FILE
...
6,210
Posted By kshelluser
?? Can you explain that a little further? ...
??

Can you explain that a little further?
How does that compare the first two characters of the filename to match a string such as "AA"

Thanks.
6,210
Posted By kshelluser
If based on filename?
ksh.

Hi,

I am trying to loop through the files in a directory, and process them one by one where a naming convention is met, this is fine.

As part of the looping process I need to check the...
11,271
Posted By kshelluser
Loop through files
Hi,

I'm trying loop through all files in a directory that have a filename starting with 'CC', and process them one by one. Can any provide an example of how I could do this. I've started with:
...
1,441
Posted By kshelluser
awk error
Hi,

I am using the following awk command to parse an exchange rates file:
awk '{if(substr($0,0,8) == "GBP_EUR=") print "3 Euros "substr($0,9,18)" NOW() SYSADMIN"}'...
29,057
Posted By kshelluser
Didn't come accross anything for MYSQL, only...
Didn't come accross anything for MYSQL, only Oracle and DB2
29,057
Posted By kshelluser
Calling MYSQL Stored Procedure?
Hi,

Can anyone help me with the correct syntax to call a MYSQL stored procedure from a shell script.

I have tried the following, (no input params):
/usr/bin/mysql -uadmin -ppassword call...
4,675
Posted By kshelluser
Great reply that, thanks it gives me somewhere to...
Great reply that, thanks it gives me somewhere to start.
4,675
Posted By kshelluser
Loading values into a MYSQL database
Where to start?

Ok, I need to pick up a Worldpay exchange rates file from a url such as:
https://select.worldpay.com/wcc/info?op=rates&instId=12345&op=rates-today

the http response returns a...
7,902
Posted By kshelluser
if within nawk command
I am trying to nawk through a file and if the 24.25.26 charachters in the file are "000" then print a line to a new file in one format, otherwise print a line in a different format.

So far I have...
7,902
Posted By kshelluser
if within nawk command
I am trying to nawk through a file and if the 24.25.26 charachters in the file are "000" then print a line to a new file in one format, otherwise print a line in a different format.

So far I have...
26,005
Posted By kshelluser
Hi, Thanks for that, it seems to work fine...
Hi,

Thanks for that, it seems to work fine although it puts an unwanted space between the row number and the next value printed out, for example if ($0,1,8) is ABCDEFGH then the output to the...
26,005
Posted By kshelluser
AWK and padding values
Hi,

I am trying to parse a file of fixed length transactions into a new file. Using awk I need to add the line number as a 5 digit long numeric value to each of the transactional rows.

i.e....
19,270
Posted By kshelluser
KSH CAT Two files into one
Quick question,

File A has one line (10 charachters), File B has one line (10 charachters).

how do a concat these two files together to produce a file (File C) that has the contents of Files A...
2,599
Posted By kshelluser
kshell variables and awk
Hi,

Is it possible to initialise a shell variable and set it to a value from an awk command?

i.e.

#set myvalue = to the first 8 charachters of the line that begins with 0
myvalue = awk...
Showing results 1 to 20 of 20

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