I have the oracle table coulns in an order like
date, state1, state2....state9
and i need to prepare data from the script output for loading in to this table
I need to prepare a text file for loading the above result in to the table based on the following condition
if col1 value is 64, corresponding col2 value is for state1 column in table
if col1 value is 80, corresponding col2 value is for state2 column in table
if col1 value is 72, corresponding col2 value is for state3 column in table
if col1 value is 71, corresponding col2 value is for state4 column in table
if col1 value is 73, corresponding col2 value is for state5 column in table
if col1 value in (38,74,75,76,77,81) corresponding sum of col2 value is for state6 column in table
if col1 value in (57,58,66) corresponding sum of col2 value is for state7 column in table
if col1 value in (34,51,53,54,55,59,62) corresponding sum of col2 value is for state8 column in table
if col1 value in (68,69) corresponding sum of col2 value is for state9 column in table
I need the data like the below format
Quote:
5 48 765 787 22407 1097 1398 0 0
Note it should add 0 for non existing values
With thanks
Aemunathan
---------- Post updated at 03:40 PM ---------- Previous update was at 01:31 PM ----------
HI
I have carried out by some round about methods ....since am an learner...
but the thing is am getting some errors as well as the correct output.
Hello:
I need to copy down some data from the previous record in to the next record based on the below conditions
If position 41- 59 of the current record is same as the previous record and the value of position 62 is not equal to 1 then
copy the previous records value for positions... (1 Reply)
Hi, Is it possible to transpose the matrix like this using awk ? Many thanks in advance
Input
abc Name_1 0
abc Name_2 1
abc Name_3 2
abc Name_4 0.4
def Name_1 0
def Name_2 9
def Name_3 78
def Name_4 1
Output
abc def
Name_1 0 ... (4 Replies)
Hi Friends,
Hope all is well.
I have an input file like this
a gene1 10
b gene1 2
c gene2 20
c gene3 10
d gene4 5
e gene5 6
Steps to reach output.
1. Print unique values of column1 as column of the matrix, which will be
a
b
c (5 Replies)
Hello Expert,
I need to transpose Date-Timestamp based on same column values and calculate time difference. The input file would be as below and required output is mentioned in the bottom
INPUT File
========
08/23/2012 12:36:09 JOB_5340
08/23/2012 12:36:14 JOB_5340
08/23/2012... (2 Replies)
hi
i have to move files and send an email and attached the bad files to inform the developer about that.
#!/bin/ksh
BASE_DIR=/data/SrcFiles
cd $BASE_DIR
## finding the files from work directory which are changed in 1 day
find -type f -name "*.csv" –ctime 0 > /home/mydir/flist.txt
##... (14 Replies)
I want to comment 2 lines based on a condition. If THEN occurs immediately after WHEN then i have to comment both the lunes
For example :
$cat file1.txt
CASE
WHEN
THEN 1
WHEN
c1= 'I'
AND c2= '0'
THEN 2
So in this example i want to... (2 Replies)
Hello,
I am looking for concatenating the lines based on conditions. Below are the contents of the file:
Infile:
-----
Test1.PO_Itm COLUMN GAC_DT.
Test1.PO_Itm COLUMN (PRODTCD ,PLNTCD).
Test1.PO_Itm COLUMN PLNTCD.
Test1.PO_Itm COLUMN ACTVIND.
Test2.RgnToTerrtryGPI COLUMN... (3 Replies)
Hi Friends,
I am new to UNIX. I need to merge all the files(to FINAL.txt) in single directory based one condition. Out of all the files one of file will have specific value like :GF01: at any where in the file.
so the file which is having :GF01: should be appended at the last.
EX:... (5 Replies)
hi ,
I have a String str="/opt/ibm/lotus/ibw/latest" or ="/opt/lotus/ibw/latest" this value is dynamic..I want to split this string into 2 strings
1. /opt/ibm/lotus(/opt/lotus) this string must ends with "lotus"
2./ibw/latest
can any body help me on this?
Regards,
sankar (2 Replies)