Sponsored Content
Full Discussion: remove duplicate
Top Forums Shell Programming and Scripting remove duplicate Post 49197 by kazanoova2 on Saturday 27th of March 2004 07:01:08 PM
Old 03-27-2004
but the record contains space

thnx Ygor, Optimus_P
but what if the record contain space
ex: my record size 5
test.txt=ab cdefr tab cdab cdefr tasdfg
the result must be
ab cdefr tasdfg
i try :
dd if=$1 of=$1.temp cbs=5 conv=unblock
sort $1.temp -u >$1.temp1
cat $1.temp1|tr "\n" " ">$1.new ?
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Remove duplicate ???

Hi all, I have a out.log file CARR|02/26/2006 10:58:30.107|CDxAcct=1405157051 CARR|02/26/2006 11:11:30.107|CDxAcct=1405157051 CARR|02/26/2006 11:18:30.107|CDxAcct=7659579782 CARR|02/26/2006 11:28:30.107|CDxAcct=9534922327 CARR|02/26/2006 11:38:30.107|CDxAcct=9534922327 CARR|02/26/2006... (3 Replies)
Discussion started by: sabercats
3 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
UNBLOCK_DEM(1)						      General Commands Manual						    UNBLOCK_DEM(1)

NAME
unblock_dem - Insert linefeeds into a Digital Elevation Model (DEM) file SYNOPSIS
unblock_dem [-L] DESCRIPTION
The drawmap program processes USGS Digital Elevation Model (DEM) files (along with other types of files) to produce customized maps. Drawmap is able to read these files in their native format. However, since the files usually don't contain any linefeeds, they are diffi- cult for a human to read. Unblock_dem filters a DEM file and inserts linefeeds for human readability. It takes input from the standard input and writes to the standard output. The input data must be in uncompressed form, not in gzip-compressed form. Also, unblock_dem does not work with SDTS DEM files or GTOPO30 files. Unblock_dem normally takes no options, but, if you use the "-L" option, the program will print out some license information and exit. Some DEM files already have embedded linefeeds. Unblock_dem makes a feeble attempt to detect these files and abort. If the detection fails, the results are likely to be garbled, so it is wise to check the format of each file first. The drawmap program, with the "-i" option, will attempt to tell you whether a file contains linefeeds or not. The intended use of unblock_dem is simply to let you conveniently examine the files to see what is in them. However, if you are in the mood for adventure, or if you need to repair a defective file, you can use unblock_dem to make the file easy to edit, then you can edit the file as desired. Drawmap can still process the files after linefeeds are inserted, but will become confused if any line (including the linefeed) is more than 1024 characters long. Drawmap may also become confused if you make any significant changes to the format of the file. You may be able to use this capability to repair faulty data. However, you need to be familiar with the content and structure of DEM files in order to do this effectively. You also need to remember that drawmap depends on DEM files having a predictable structure, and it won't properly parse files that violate this predictability. Do this sort of thing only if you know what you are doing, or if you have a lot of free time on your hands. It should be noted that you can obtain a similar effect by using the command recommended by the USGS: dd if=inputfilename of=outputfilename ibs=4096 cbs=1024 conv=unblock I prefer the unblock_dem command because it simply replaces the last byte of each record with a linefeed. This lets me easily tell how long the original records were. The effect of unblock_dem or dd can be undone by typing: dd if=inputfilename of=outputfilename ibs=4096 cbs=1024 conv=block You may come across files that have a linefeed in the 1025th byte. Drawmap doesn't like these, both because it can't tell (within the space of the first 1024-byte record) whether the file contains linefeeds or not, and because the records exceed the maximum record length of 1024 bytes. You may be able to repair such files by blocking them with the above dd command. SEE ALSO
unblock_dlg(1), drawmap(1) Jul 24, 2001 UNBLOCK_DEM(1)
All times are GMT -4. The time now is 11:29 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy