Sponsored Content
Top Forums Shell Programming and Scripting Reading and analysing data in a text file Post 302479879 by rajneesh_kapoor on Monday 13th of December 2010 06:50:21 AM
Old 12-13-2010
Reading and analysing data in a text file

Hi,
I have below type of data in a text file in unix.
Emp_Name Emp_Dept
Raj 101
Amruta 100
Shilpa 100
Rohit 123
Amol 198
Rosh 101
Gaurav 198


Number of employees can be even more.
Need a command or a shell script which gives the output as dept number and no. of employees in individual department.
For eg
100 2
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Using loop reading a file,retrieving data from data base.

Hi All, I am having trouble through, I am reading the input from tab delimited file containing several records, e.g. line1 field1 field2 field3 so on.. line2 field1 field2 field3 so on.. .. .. on the basis of certain fields for each record in input file, I have to retrieve... (1 Reply)
Discussion started by: Sonu4lov
1 Replies

2. UNIX for Dummies Questions & Answers

Help analysing progress of a log file

Is it possible to track the progress of a job (informatica) by analysing the progress of it's log file ? I have a long running job, and no way of tracking how far allong it is. Thanks. (4 Replies)
Discussion started by: cosmos328is
4 Replies

3. HP-UX

Query: Analysing the Core file

Hi, Is there any way to find the mode of the binary file (debug or release) by analyzing the core file generated by that binary on the HPUX11i Platform? (5 Replies)
Discussion started by: Prajakta
5 Replies

4. Shell Programming and Scripting

reading data from .ini file

Hi, I have a sample data file that contains name-value pairs in it. For example: name1=value1 name2=value2 name3=value3 ... ... ... My concern is 1. How to get values of name1, name2, name3 using korn shell script? 2. I don't want to access each varible using $name1,$name2, $name3... (2 Replies)
Discussion started by: vinna
2 Replies

5. Shell Programming and Scripting

how to insert data into database by reading it from a text file??

Hi....can you guys help me out in this script?? Below is a text file and it contains these: GEF001 000093625 MKL002510 000001 000000 000000 000000 000000 000000 000001 GEF001 000093625 MKL003604 000001 000000 000000 000000 000000 000000 000001 GEF001 000093625 MKL005675 000001... (4 Replies)
Discussion started by: pallavishetty
4 Replies

6. Shell Programming and Scripting

Reading data from a specific line in a text file

hello, I have got the following problem that I am hoping someone can help with please. 1. I have got the following text file (below) , the columns data are 'Test Day', 'Board', 'Betting Number'. TEXT FILE ============================================ 1 3 02-01-27-28-29-30 0 1... (1 Reply)
Discussion started by: jermaine4ever
1 Replies

7. Shell Programming and Scripting

Reading data from a specific line in a text file

Hello, I have a problem which is giving me headache for days, can some please help. Please see code and text fiel below. Please see text in red for the problem I am facing # Program gets an input x from user while read line ; do echo... (4 Replies)
Discussion started by: jermaine4ever
4 Replies

8. Shell Programming and Scripting

Perl: Reading data from other file

Hi, I am writting some perl scripts for daily backup process. In which I want to pass some data/referance from another txt file. Text file contains only one column and multiple rows. I want to pass this data to variables of another perl script. e.g. Refdoc.txt file contains data as: perl1... (3 Replies)
Discussion started by: n.dba
3 Replies

9. Shell Programming and Scripting

reading data from a file to an array

I need some help with this code below, i doesnt know why it will run twice with my function, but my function only got if else, any other way that can read line and put into array? while read line; do read -A array <<<$line n=${#array} for ((i=1;i<$n;i++)); do print... (1 Reply)
Discussion started by: gavin_L
1 Replies

10. Shell Programming and Scripting

Reading data from file using awk

I have a file as below. It contains two data sets separated by >. I want to pipe each data set to another program called psxy. How can I get the different records Have started doing as follows but it only passes the first data set awk 'BEGIN {RS=">"};{print $0}' p.dat cat p.dat... (12 Replies)
Discussion started by: kristinu
12 Replies
Net::SIP::DTMF(3pm)					User Contributed Perl Documentation				       Net::SIP::DTMF(3pm)

NAME
Net::SIP::DTMF - DTMF RTP packet generating and extracting SYNOPSIS
use Net::SIP::DTMF; my $sub = dtmf_generator( 11, # event '#' 100, # duration 100ms rfc2833_type => 101, # RTP type 101 for telephone-event/8000 # audio_type => 0, # RTP type 0 for PCMU/8000 ); while (...) { my @pkt = $sub->($sequence,$timestamp,$srcid); last if ! @pkt; # dtmf done next if $buf[0] eq ''; # more coming, but no data this time (pause) .. send @pkts ... } use Net::SIP::DTMF; my $sub = dtmf_extractor( rfc2833_type => 101, # RTP type 101 for telephone-event/8000 audio_type => 0, # RTP type 0 for PCMU/8000 ); while (...) { if ( my ($event,$duration,$type) = $sub->($packet)) { # event received ... } } DESCRIPTION
This package provides functions for generating RTP packets containing DTMF events or extracting DTMF events from RTP packets. FUNCTIONS
dtmf_generator ( EVENT, DURATION, %ARGS ) Generates a function which is used to generate packets for the given EVENT. EVENT is the event numer (0..15) or undef if it should just generate silence or pause. DURATION is the time for the event in ms. ARGS contain information how the event should be packed: either as RFC2833 RTP event or as RTP audio PCMU/8000. %ARGS can be rfc2833_type => rtp_type Gives the RTP payload type number for rfc2833 RTP events (telephone-event/8000). If not given will try audio_type instead. audio_type => rtp_type Gives the RTP payload type number for PCMU/8000. If not given and no rfc2833_type given it will croak. volume => volume Sets the volume for RTP event according to rfc2833. The generated function should then be called with SEQUENCE,TIMESTAMP,SRCID to generate the RTP packets and will return @RTP_PACKETS, with () - DTMF event is finished $RTP_PACKETS[0] eq '' - no RTP packet for this call (pause) @RTP_PACKETS - RTP packets which can be send to the peer dtmf_extractor ( %ARGS ) Generates a function which is used to extract DTMF events. Keys rfc2833_type and audio_type have the same meaning as in generate_dtmf. It will only attempt to extract DTMF events from rfc2833 RTP events or audio if the relevant rtp_type is given. The function will be called with the RTP packet as the only argument and will return () if no new events where found or (EVENT,DURATION,TYPE) if an event finished, where DURATION is the duration in ms and TYPE is audio|rfc2833. For performance reasons it is best to use only rfc2833 if the peer supports it. perl v5.14.2 2012-06-12 Net::SIP::DTMF(3pm)
All times are GMT -4. The time now is 06:30 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy