Sponsored Content
Full Discussion: awk math and csv output
Top Forums Shell Programming and Scripting awk math and csv output Post 302721953 by nakaedu on Friday 26th of October 2012 05:30:47 AM
Old 10-26-2012
awk math and csv output

Hi I have this list
Code:
 
592;1;Z:\WB\DOCS;/FS3_100G/FILER112/BU/MPS/DOCS;;;;\\FILER112\BUMPS-DOCS\;580,116,544,878 Bytes;656,561 ;77,560 
592;2;Z:\WB\FOCUS;/FS3_100G/FILER112/BU/MPS/FOCUS;;;;\\FILER112\BUMPS-FOCUS\;172,430 Bytes;6 ;0 
896;3;Z:\WB\FUNDONFUND;/FS3_100G/FILER112/BU/MPS/FUNDONFUND;;;;\\FILER112\BUMPS-FOFUND\;0 Bytes;0 ;0 
592;4;Z:\WB\MONARCH;/FS3_100G/FILER112/BU/MPS/MONARCH;;;;\\FILER112\BUMPS-MON\;14,531,579 Bytes;137 ;3 
931;5;S:\X\DIST\DV;/FS7_100G/FILER104/BU-D/DIST/DV;;;;\\FILER104\BUDIST-DV\;452,928,819 Bytes;10 ;2

Delimiter semicolon ;
Field #9 is the folder size

I would like to have the same list instead of bytes converted to GB

I tried to run
Code:
 
awk -F ";" '{print $9/1024/1024/1024}' file

but it does not work.
Help is appreciated, it could also be in perl.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Math with wordcount output

Hi I know very little about unix. I have a unix code (which I'm running in geektools) which gives me the word count of a pages document. However, the pages document innately contains 522 words of superfluous "Ipsem Lorem..." text which are included in the count. How would I go about... (4 Replies)
Discussion started by: eunoia7
4 Replies

2. UNIX for Dummies Questions & Answers

awk logic and math help

Hi, My file has 2 fields and millions of lines. variableStep chrom=Uextra span=25 201 0.5952 226 0.330693 251 0.121004 276 0.0736858 301 0.0646982 326 0.0736858 401 0.2952 426 0.230693 451 0.221004 476 0.2736858 Each field either has a... (6 Replies)
Discussion started by: wyarosh
6 Replies

3. Shell Programming and Scripting

awk math operation on two files

Hi, I need your help. I've got two files and i need to add 2nd line after occurrence of "Group No X" from data2.txt to 3rd line (after occurrence of "Group No X") from data1.txt. There is the same number of "Groups" in both files and the numbers of groups have the same pattern. data1.txt Group... (2 Replies)
Discussion started by: killerbee
2 Replies

4. Shell Programming and Scripting

Need help with AWK math

I am trying to do some math, so that I can compare the average of six numbers to a variable. Here is what it looks like (note that when I divide really big numbers, it isn't a real number): $ tail -n 6 named.stats | awk -F\, '{print$1}' 1141804 1140566 1139429 1134210 1084682 895045... (3 Replies)
Discussion started by: brianjb
3 Replies

5. Shell Programming and Scripting

awk --> math-operation in a array

Hi main object is categorize the difference of data-values (TLUFT02B - TLUFT12B). herefor i read out data-files which are named acording to the timeformat yyyymmddhhmm. WR030B 266.48 Grad 0 WR050B 271.46 Grad 0 WR120B 268.11 Grad 0 WV030B 2.51 m/s ... (6 Replies)
Discussion started by: IMPe
6 Replies

6. Shell Programming and Scripting

Count math using awk

Hi expert, I have log : TOTAL-TIME : 2125264636 DATA-BYTES-DOWN : 3766111307032 DATA-BYTES-UP : 455032157567 DL = (3766111307032/2125264636)/1024 = 1.73 UL = (455032157567/2125264636)/1024 = 0.21 I want the result : TOTAL = 1.94 ... (4 Replies)
Discussion started by: justbow
4 Replies

7. Shell Programming and Scripting

Math count %memory using awk

Hi expert, i have log this: Memory: 74410384 Memory: 75831176 Memory: 77961232 Memory: 77074656 Memory: 76086160 Memory: 77128592 Memory: 78045384 Memory: 76696040 Memory: 72401176 Memory: 72520016 Memory: 72137016 Memory: 73175832 Memory: 73034528 Memory: 71770736 Memory:... (4 Replies)
Discussion started by: justbow
4 Replies

8. Shell Programming and Scripting

Help! Printing out CSV output from awk Pattern Match

Hi, I need to search for a word using Awk and print out the line the word is in and every line after the search phrase until I hit this #------------. Then I need to send it to a csv file. So basically the input file format is like this:... (1 Reply)
Discussion started by: An0mander
1 Replies

9. Shell Programming and Scripting

How to parse this file using awk and output in CSV format?

My source file looks like this: Cust-Number = "101" Cust-Name="Joe" Cust-Town="London" Cust-hobby="tennis" Cust-purchase="200" Cust-Number = "102" Cust-Name="Mary" Cust-Town="Newyork" Cust-hobby="reading" Cust-purchase="125" Now I want to parse this file (leaving out hobby) and... (10 Replies)
Discussion started by: Balav
10 Replies

10. UNIX for Beginners Questions & Answers

awk and sed script to create one output CSV file

Hi All , I would require your help to generate one output file after post processing of one CSV file as stated below This file is just a small cut from a big file . Big file is having 20000 lines PATTERN,pat0,pat1,pat2,pat3,pat4,pat5,pat6,pat7,pat8,pat9... (2 Replies)
Discussion started by: kshitij
2 Replies
mpcd(8) 						       Maintenance Commands							   mpcd(8)

NAME
mpcd - ATM MPOA (Multi-Protocol Over ATM) client daemon SYNOPSIS
mpcd [ -s Control ATM address ] [ -l Data ATM address ] [ -c MPS control ATM address ] [ -i Interface number ] [ -m MPS MAC address ] [ -L LEC address [ -n ELAN name ] [ -C LECS Address ]] DESCRIPTION
MPOA client (MPC) is responsible for creating and receiving internetwork layer shortcuts. Using these shortcuts MPCs forward unicast inter- network layer packets effectively over ATM without need for routing protocols. MPC has two roles; ingress and egress. In ingress role MPC detects flows destined outside it's own subnet and tries to establish shortcuts to those destinations. In egress role MPC accepts shortcuts and packets arriving on those shortcuts. Maintaining shortcuts is done with the help of MPOA server (MPS). Just as the Linux LAN Emulation client, MPOA client is also divided in two parts. The parts are kernel component and a daemon process. The daemon opens and receives data shortcuts and control connections with the kernel component. The kernel component tallies packets flowing out from the LANE device and makes the decision if a packet should be forwarded using LANE or MPOA shortcuts. If the daemon is killed with SIGHUP it will close all the open connections, purge ingress and egress cache entries, query LECS if applica- ble and then restart itself. Linux MPOA client only supports non-LLC-muxed shortcuts. The number of supported MPOA clients is unlimited. OPTIONS
-s Control ATM address Local ATM address this MPC uses for MPOA control connections. -l Data ATM address Local ATM address from and to which MPOA shortcuts are established. -c MPS control ATM address ATM address of MPS. Only needed if MPS can not advertise it by itself. -i Interface number The interface number of LEC this MPC serves. E.g. 2 for "lec2". -m MPS MAC address MAC address of default router where MPS recides. Only useful if the MPOA server fails to advertise itself. -L LEC address Listen address of the LANE client zeppelin. mpcd uses this address as its own ATM address when it queries LECS for MPC configuration parameters. If this option is not present then mpcd will not use LECS to query for configuration parameters. This option is normally the same as zeppelin's -l option. -n ELAN name Name of the ELAN for which mpcd asks for parameters when it connects to LECS. If this option is not given, LECS should respond with parameters belonging to the default ELAN if one exists. This option is normally the same as zeppelin's -n option. -C LECS address ATM address of LECS mpcd asks for parameters. If this option is left empty and -L is given, mpcd uses ATM Forum assigned Well-Known LECS address. This option is normally the same as zeppelin's -c option. EXAMPLES
This script snippet shows how to run LANE and MPOA. After UNI signalling and ILMI have been started LANE (zeppelin) and MPOA (mpcd) are started. The commented out line shows how to start mpcd so that it queries LECS for MPC parameters. Arguments jaarli[1-3] are local ATM addresses listed in file /etc/hosts.atm. ATM=/usr/src/atm case "$1" in start) cd $ATM if [ -x sigd/atmsigd ] ; then sigd/atmsigd -b fi if [ -x ilmid/ilmid ] ; then ilmid/ilmid -b -x fi if [ -x led/zeppelin ] ; then led/zeppelin -2 -n sampo -i2 -l jaarli3 & ifconfig lec2 10.10.10.208 netmask 255.255.255.192 broadcast 10.10.10.255 ifconfig lec2 up route add default gw 10.10.10.193 fi if [ -x mpoad/mpcd ] ; then mpoad/mpcd -i2 -s jaarli1 -l jaarli2 & #mpoad/mpcd -i2 -s jaarli1 -l jaarli2 -L jaarli3 -n sampo & fi ;; esac exit 0 BUGS
Supports only Ethernet type of ELANs. Probably others too. AUTHORS
Heikki Vatiainen <hessu@cs.tut.fi>, Sampo Saaristo <s156953@cs.tut.fi> SEE ALSO
zeppelin(8), atmsigd(8) Linux Nov 17, 1998 mpcd(8)
All times are GMT -4. The time now is 04:17 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy