Sponsored Content
Full Discussion: Tough Oracle Logic in Ux
Top Forums UNIX for Advanced & Expert Users Tough Oracle Logic in Ux Post 302396809 by magedfawzy on Friday 19th of February 2010 10:46:09 AM
Old 02-19-2010
What i am trying to do is ..

I have a CSV file with columns
Code:
SERVICE_TYPE
    ,TOTAL_TYPE
    ,CALL_INDICATOR
    ,A_NUMBER
    ,APN
    ,DAY
    ,HOUR
    ,PARTIAL_INDICATOR
    ,EQUIPMENT_ID_A
    ,LOCATION_AREA_ID
    ,DW_BATCH_ID
* DURATION 
* DATA_VOLUME_INCOMING
* DATA_VOLUME_OUTGOING
* CALL

& required to do some special aggregation:


1) for common lines having equal values
(SERVICE_TYPE,TOTAL_TYPE,CALL_INDICATOR,A_NUMBER,APN,DAY,HOUR)
Aggregate/(i.e. sum) (*) columns
While keeping first appearing values for rest of columns
Code:
(PARTIAL_INDICATOR
    ,EQUIPMENT_ID_A
    ,LOCATION_AREA_ID
    ,DW_BATCH_ID)

ex:
Code:
1,2,3,4,6,7,0
1,2,3,5,3,6,7

for lines with (1,2,3)
sum last 2 columns, (13,7)
while having 4,6 at the result

result: 1,2,3,4,6,*13,*7

Thanks

Last edited by Scott; 02-19-2010 at 08:10 PM.. Reason: Please use code tags
 

We Also Found This Discussion For You

1. UNIX for Dummies Questions & Answers

tough parsing

I have a string as "Period= 20090531 Client Name= Clayton Lumbar Company Destination= MD" I want to parse the string and store it in 3 different variables. $period (should get value 20090531) $client (should get value "Clayton Lumbar company") $dest (should get value MD) How can I do... (3 Replies)
Discussion started by: paruthiveeran
3 Replies
COLUMN(1)						    BSD General Commands Manual 						 COLUMN(1)

NAME
column -- columnate lists SYNOPSIS
column [-tx] [-c columns] [-s sep] [file ...] DESCRIPTION
The column utility formats its input into multiple columns. Rows are filled before columns. Input is taken from file operands, or, by default, from the standard input. Empty lines are ignored. The options are as follows: -c Output is formatted for a display columns wide. -s Specify a set of characters to be used to delimit columns for the -t option. -t Determine the number of columns the input contains and create a table. Columns are delimited with whitespace, by default, or with the characters supplied using the -s option. Useful for pretty-printing displays. -x Fill columns before filling rows. Column exits 0 on success, >0 if an error occurred. ENVIRONMENT
COLUMNS The environment variable COLUMNS is used to determine the size of the screen if no other information is available. EXAMPLES
(printf "PERM LINKS OWNER GROUP SIZE MONTH DAY HH:MM/YEAR NAME " ; ls -l | sed 1d) | column -t SEE ALSO
colrm(1), ls(1), paste(1), sort(1) HISTORY
The column command appeared in 4.3BSD-Reno. AVAILABILITY
The column command is part of the util-linux-ng package and is available from ftp://ftp.kernel.org/pub/linux/utils/util-linux-ng/. BSD
June 6, 1993 BSD
All times are GMT -4. The time now is 12:37 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy