Sponsored Content
Full Discussion: Remove duplicate ???
Top Forums Shell Programming and Scripting Remove duplicate ??? Post 101675 by Perderabo on Friday 10th of March 2006 04:55:40 PM
Old 03-10-2006
Not sure that I understand what you want. But maybe this does it...
Code:
#! /usr/bin/ksh
IFS="|"
first=1
exec < out.log
while read  name field2 field3; do
        if ((first)) ; then
                first=0
                oldname=$name
                output="${name}${field2}|${field3}"
        elif [[ $name != $oldname ]] ; then
                echo "$output"
                output="${name}${field2}|${field3}"
                oldname=$name
        else
                output="${output}|${field3}"
        fi

done
echo "$output"
exit 0

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

remove duplicate

i have a text its contain many record, but its written in one line, i want to remove from that line the duplicate record, not record have fixed width ex: width = 4 inputfile test.txt =abc cdf abc abc cdf fgh fgh abc abc i want the outputfile =abc cdf fgh only those records can any one help... (4 Replies)
Discussion started by: kazanoova2
4 Replies

2. Shell Programming and Scripting

Remove duplicate

Hi all, I have a text file fileA.txt DXRV|02/28/2006 11:36:49.049|SAC||||CDxAcct=2420991350 DXRV|02/28/2006 11:37:06.404|SAC||||CDxAcct=6070970034 DXRV|02/28/2006 11:37:25.740|SAC||||CDxAcct=2420991350 DXRV|02/28/2006 11:38:32.633|SAC||||CDxAcct=6070970034 DXRV|02/28/2006... (2 Replies)
Discussion started by: sabercats
2 Replies

3. UNIX for Dummies Questions & Answers

Remove duplicate in array

Hi, I have a list of numbers stored in an array as below. 5 7 10 30 30 40 50 Please advise how could I remove the duplicate value in the array ? Thanks in advance. (5 Replies)
Discussion started by: Rock
5 Replies

4. Shell Programming and Scripting

remove duplicate

Hi, I am tryung to use shell or perl to remove duplicate characters for example , if I have " I love google" it will become I love ggle" or even "I loveggle" if removing duplicate white space Thanks CC (6 Replies)
Discussion started by: ccp
6 Replies

5. Shell Programming and Scripting

Help with remove duplicate content

Input file data_1 10 US data_1 2 US data_1 5 UK data_2 20 ENGLAND data_2 12 KOREA data_3 4 CHINA . . data_60 123 US data_60 23 UK data_60 45 US Desired output file data_1 10 US data_1 5 UK data_2 20 ENGLAND data_2 12 KOREA (2 Replies)
Discussion started by: perl_beginner
2 Replies

6. Shell Programming and Scripting

How to remove duplicate ID's?

HI I have file contains 1000'f of duplicate id's with (upper and lower first character) as below i/p: a411532A411532a508661A508661c411532C411532 Requirement: But i need to ignore lowercase id's and need only below id's o/p: A411532 A508661 C411532 (9 Replies)
Discussion started by: buzzme
9 Replies

7. Shell Programming and Scripting

Remove duplicate

Hi , I have a pipe seperated file repo.psv where i need to remove duplicates based on the 1st column only. Can anyone help with a Unix script ? Input: 15277105||Common Stick|ESHR||Common Stock|CYRO AB 15277105||Common Stick|ESHR||Common Stock|CYRO AB 16111278||Common Stick|ESHR||Common... (12 Replies)
Discussion started by: samrat dutta
12 Replies

8. UNIX for Dummies Questions & Answers

Remove duplicate

Hi, How can I replace || with space and then remove duplicate from following text? T111||T222||T444||T222||T555 Thanks in advance (10 Replies)
Discussion started by: tinku981
10 Replies

9. UNIX for Dummies Questions & Answers

Remove Duplicate Lines

Hi I need this output. Thanks. Input: TAZ YET FOO FOO VAK TAZ BAR Output: YET VAK BAR (10 Replies)
Discussion started by: tara123
10 Replies

10. Shell Programming and Scripting

How to remove duplicate lines?

Hi All, I am storing the result in the variable result_text using the below code. result_text=$(printf "$result_text\t\n$name") The result_text is having the below text. Which is having duplicate lines. file and time for the interval 03:30 - 03:45 file and time for the interval 03:30 - 03:45 ... (4 Replies)
Discussion started by: nalu
4 Replies
PPP(1)							      General Commands Manual							    PPP(1)

NAME
pppclient, pppserver - point to point protocol SYNOPSIS
pppclient [ -d ][ -b baudrate ][ -i myipaddr ][ -p peeripaddr ][ dialdevice ] pppserver [ -d ] ndev myipaddr firstipaddr firstdev [ baud0 baud1 ... ] DESCRIPTION
The Point to Point Protocol is used to encapsulate Internet Protocol packets for transfer over serial lines or other protocol connections. Pppclient makes a connection to a PPP server and passes IP packets over the connection. If dialdevice is omitted, standard input and out- put are used as the connection. If dialdevice begins with a slash, pppclient assumes it is a file name, open(2)'s it, and uses the result as the connection. Otherwise, dialdevice is passed as the destination address to dial(2) to set up the connection. If the connection is successful, pppclient creates a pipe, pushes the IP line discipline onto it, and sets the local and remote addresses of the IP interface to myipaddr and peeripaddr. It then loops transferring packets between the pipe and the connection. If either myi- paddr or peeripaddr is omitted, pppclient requests them from the server. The options are d print debugging information. b baud rate of the serial line. p peer ip address (in case the peer asks for its ip address over IPCP). i the local ip address to be established for this connection. Pppserver treats serial lines as PPP connections, switching packets between them and the local machine. It creates a pipe for a local IP interface (address myipaddr), opens a set of serial lines, and switches packets between the local interface and the serial lines. Ndev specifies the number of serial devices to serve. The devices are named /dev/eia{firstdev} through /dev/eia{firstdev+ndev-1}. Their remote IP addresses are firstipaddr through firstipaddr+ndev-1. The default baud rate is 9600. If any arguments follow firstdev (baud0, baud1, ...), they are used as baud rates for the serial lines. The only option, -d, turns on debugging output. Both pppclient and pppserver accept all options defined in RFCs 1331 and 1332. EXAMPLES
Start up a server for serial lines /dev/eia[2-6] with remote IP addresses 131.107.1.100 through 131.107.1.103 and baud rates of 19200, 2400, 9600, 9600. The local IP address is 131.107.1.1. pppserver 4 131.107.1.1 131.107.1.100 2 19200 2400 SOURCE
/sys/src/cmd/ppp PPP(1)
All times are GMT -4. The time now is 11:57 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy