Sponsored Content
Top Forums Shell Programming and Scripting Using awk command for .csv file Post 302376621 by sushmab82 on Wednesday 2nd of December 2009 12:28:15 AM
Old 12-02-2009
Hi Dennis,
Please find sample input and output

input:
StartTime;LastResetTime;CurrentTime;ElapsedTime(P);ElapsedTime(C);Rate(P);Rate(C);IncomingCall(P);In comingCall(C);OutgoingCall(P);OutgoingCall(C);MsgRecvPerS(P);MsgRecvPerS(C);MsgSendPerS(P);MsgSendPe rS(C);UnexpectedMsg(P);UnexpectedMsg(C);CurrentCall;InitSuccessfulCall(P);InitSuccessfulCall(C);Traf ficSuccessfulCall(P);TrafficSuccessfulCall(C);DefaultSuccessfulCall(P);DefaultSuccessfulCall(C);Abor tSuccessfulCall(P);AbortSuccessfulCall(C);FailedCall(P);FailedCall(C);FailedRefused(P);FailedRefused (C);FailedAborted(P);FailedAborted(C);FailedTimeout(P);FailedTimeout(C);ResponseTime(P);ResponseTime (C);ResponseTimeRepartition;<50;<75;<100;<150;<300;<5000;>=5000;
2009-10-23 16:55:14;2009-10-23 16:55:14;2009-10-23 16:55:14;00:00:00;00:00:00;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;00:00:00:000;00 :00:00:000;;0;0;0;0;0;0;0;
2009-10-23 16:55:14;2009-10-23 16:55:15;2009-10-23 16:55:15;00:00:01;00:00:01;1.998;1.99005;0;0;2;2;1.998;1.99005;2.997;2.98507;1;1;1;1;1;0;0;0;0;0;0;0 ;0;0;0;0;0;0;0;00:00:00:439;00:00:00:439;;0;0;0;0;0;1;0;

Output :
array_16 = column16
last_value = column_16_lastrecord

---------- Post updated at 12:28 AM ---------- Previous update was at 12:20 AM ----------

Hi Shan,
Thanks for ur reply.
Since .csv file containes 50 lacs of records, If I use for loop and store into array takes too much of time. And I don't want to store all coulmns data, only selected column I need to store. Please suggest if any method of doing without iterating to each row of the file.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

creating a csv file in awk

Hi All I am trying to create a csv file in the korn shell and the script segment is as follows: if then # NEED TO ADD INFO TO THE EMAIL FILE ABOUT THE DRIVE THAT'S FILLING UP echo "$drive $percent% $space "|\ awk '{printf("%d/t"|"%d/t"|"%d/t\n",... (6 Replies)
Discussion started by: Segwar
6 Replies

2. Shell Programming and Scripting

Awk to convert a flat file to CSV file

Hi , I have a file with contents as below: Contract Cancellation Report UARCNCL LOS CODE DATE REAS TYPE AMOUNT AMOUNT LETTER BY ========= ======= ==== ==== ==== ========= ==== ==== 8174739 7641509 1S NONE CRCD 30-JUN-2008 NPAR N .00 .00 CCAN 8678696 8091709 1S NONE DDEB 30-JUN-2008... (14 Replies)
Discussion started by: rkumudha
14 Replies

3. Shell Programming and Scripting

awk/sed/something else for csv file

Hi, I have a filename.csv in which there are 3 colums, ie: Name ; prefixnumber ; number root ; 020 ; 1234567 user1,2,3 ; 070 ; 7654321 What I want is to merge colum 2 and 3 that it becomes 0201234567 or even better +31201234567 so the country number is used and drop the leading 0.... (9 Replies)
Discussion started by: necron
9 Replies

4. Shell Programming and Scripting

CSV to SQL insert: Awk for strings with multiple lines in csv

Hi Fellows, I have been struggling to fix an issue in csv records to compose sql statements and have been really losing sleep over it. Here is the problem: I have csv files in the following pipe-delimited format: Column1|Column2|Column3|Column4|NEWLINE Address Type|some descriptive... (4 Replies)
Discussion started by: khayal
4 Replies

5. UNIX for Dummies Questions & Answers

xml to csv using sed and awk command

Hi Guys, Can you help me in creating shell script using sed,awk etc commands to generate csv file using xml file. (5 Replies)
Discussion started by: sbk
5 Replies

6. Shell Programming and Scripting

Awk to convert a text file to CSV file with some string manipulation

Hi , I have a simple text file with contents as below: 12345678900 971,76 4234560890 22345678900 5971,72 5234560990 32345678900 71,12 6234560190 the new csv-file should be like: Column1;Column2;Column3;Column4;Column5 123456;78900;971,76;423456;0890... (9 Replies)
Discussion started by: FreddyDaKing
9 Replies

7. Shell Programming and Scripting

Csv file separate using awk

Hi, I have file like below apple,orange,pineapple,pappya,guva,avocado want to store as apple orange pineapple pappya I tried below command to seprate first field command1: (3 Replies)
Discussion started by: stew
3 Replies

8. Shell Programming and Scripting

awk command to manipulate csv file in UNIX

Hi, I am new to awk/unix and am trying to put together a script to manipulate the date column in a csv file. I have file1.csv with the following contents: Date,ID,Number,Amount,Volume,Size 01-Apr-2014,WERFG,998,105873.96,10873.96,1342.11 01-Apr-2014,POYFR,267,5681.44,5681.44,462.96 I... (2 Replies)
Discussion started by: Prit Siv
2 Replies

9. Shell Programming and Scripting

awk command to manipulate csv file in UNIX

Hi, I am new to awk and unix programming and trying to manipulate a csv file. My current csv file looks like this: col1,col2,col3,col4,col5,col4,col5,col6,col7,col8 223,V,c,2,4,f,r,,y,z 223,V,c,3,2,f,r,,y,z 223,V,c,1,4,f,r,,y,z 223,V,c,4,3,f,r,,y,z 227,V,c,3,1,f,r,,y,z... (8 Replies)
Discussion started by: Prit Siv
8 Replies

10. Shell Programming and Scripting

What does the sed command here exactly doing to csv file?

I have the following csv file at the path; now using sed command. what is this exactly doing. sed -i 's//,/g' /FTP/LAB_RESULT_CM.csv Thank you very much for the helpful info. (2 Replies)
Discussion started by: cplusplus1
2 Replies
AUINFO(1)						      General Commands Manual							 AUINFO(1)

NAME
auinfo - show information about a Network Audio System server SYNOPSIS
auinfo [-audio servername] DESCRIPTION
The auinfo program provides information describing a Network Audio System server. It lists the capabilities of the server, the devices that are attached to it, the data formats that are accepted, and any predefined sounds that have been stored in the server. EXAMPLE
The following example shows the output produced by auinfo when connected to an NCD MCX(tm) display station: Audio Server: tcp/lemkemcx:8000 Version Number: 2.0 Vendor: Network Computing Devices Inc. Vendor Release: 3000 Min Sample Rate: 1000 Max Sample Rate: 52000 Max Tracks: 32 Number of Formats: 7 Formats: ULAW8 LinearUnsigned8 LinearSigned8 LinearSigned16MSB LinearUnsigned16MSB LinearSigned16LSB LinearUnsigned16LSB Number of Elem Types: 11 Element Types: ImportClient ImportDevice ImportBucket Bundle MultiplyConstant AddConstant Sum ExportClient ExportDevice ExportBucket ExportMonitor Number of Wave Forms: 0 Number of Actions: 2 Actions: ChangeState SendNotify Number of Devices: 5 Device 0: Changable: Gain LineMode ID: 0x34 Kind: PhysicalInput Use: Import Format: LinearSigned16MSB Num Tracks: 1 Access: Import List Description: "Mono Channel Input" Min Rate: 1000 Max Rate: 52000 Location: Left Right External Gain Percent: 15 Line Mode: High Device 1: Changable: Gain ID: 0x32 Kind: PhysicalOutput Use: Export Format: LinearSigned16MSB Num Tracks: 2 Access: Export List Description: "Stereo Channel Output" Min Rate: 1000 Max Rate: 52000 Location: Left Right External Gain Percent: 24 Num Children: 2 Children: 0x30 0x31 Device 2: Changable: Gain ID: 0x33 Kind: PhysicalOutput Use: Export Format: LinearSigned16MSB Num Tracks: 1 Access: Export List Description: "Mono Channel Output" Min Rate: 1000 Max Rate: 52000 Location: Left Right External Gain Percent: 24 Num Children: 2 Children: 0x30 0x31 Device 3: Changable: Gain ID: 0x31 Kind: PhysicalOutput Use: Export Format: LinearSigned16MSB Num Tracks: 1 Access: Export List Description: "Right Channel Output" Min Rate: 1000 Max Rate: 52000 Location: Right External Gain Percent: 24 Num Children: 0 Device 4: Changable: Gain ID: 0x30 Kind: PhysicalOutput Use: Export Format: LinearSigned16MSB Num Tracks: 1 Access: Export List Description: "Left Channel Output" Min Rate: 1000 Max Rate: 52000 Location: Left External Gain Percent: 24 Num Children: 0 Number of Buckets: 0 Bucket 0: ID: 0x1400008 Kind: Bucket Use: Import Export Format: ULAW8 Num Tracks: 1 Access: Import Export Destroy List Description: "Monty Python - Australian Table Wines" Sample Rate: 8000 Num Samples: 697944 Bucket 1: ID: 0x1400007 Kind: Bucket Use: Import Export Format: LinearUnsigned8 Num Tracks: 1 Access: Import Export Destroy List Description: ""I'm sorry Dave, I can't do that" - HAL from 2001" Sample Rate: 22255 Num Samples: 85504 Bucket 2: ID: 0x1400006 Kind: Bucket Use: Import Export Format: LinearUnsigned8 Num Tracks: 1 Access: Import Export Destroy List Description: ""He's dead, Jim" - Dr. McCoy" Sample Rate: 11128 Num Samples: 31602 ENVIRONMENT
AUDIOSERVER This variable specifies the default audio server to contact if -audio is not specified on the command line. DISPLAY If AUDIOSERVER is not set, this variable is examined to find the name of the corresponding X Window System display. SEE ALSO
nas(1) COPYRIGHT
Copyright 1993, 1994 Network Computing Devices, Inc. See nas(1) for a full statement of rights and permissions. AUTHOR
Jim Fulton, Network Computing Devices, Inc. 1.9.3 AUINFO(1)
All times are GMT -4. The time now is 08:07 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy