Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Delete repeated nos in a file Post 302231517 by gini on Tuesday 2nd of September 2008 01:37:15 PM
Old 09-02-2008
Java Delete repeated nos in a file

Hi,
I need to delete repeated nos in a file and finally list the count. Can some one assist me?
file:
12345
12345
56345
12345
23896

Output needed:
12345
56345
23896

Total count:3

Thanks
 

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

how to find a word repeated in a file

Hi everyone, I have a file in which a word is repeated more than one time and I want to know how many times it is repeated. ex: if i repeated word 'guru' in 10 lines I can get the o/p as: cat filename | grep -c 'guru'. How ever if the word is repeated more than one time, then how can I... (4 Replies)
Discussion started by: gurukottur
4 Replies

2. Shell Programming and Scripting

Delete repeated rows from a file

Hi everybody: Could anybody tell me how I can delete repeated rows from a file?, this is, for exemple I have a file like this: 0.490 958.73 281.85 6.67985 0.002481 0.490 954.833 283.991 8.73019 0.002471 0.590 950.504 286.241 6.61451 0.002461 0.690 939.323 286.112 6.16451 0.00246 0.790... (8 Replies)
Discussion started by: tonet
8 Replies

3. Shell Programming and Scripting

Delete repeated word in text file

Hi expert, I am using C shell. And i trying to delete repeated word. Example file.txt: BLUE YELLOW RED VIOLET RED RED BLUE WHITE YELLOW BLACK and i wan store the output into a new file: BLUE (6 Replies)
Discussion started by: vincyoxy
6 Replies

4. Shell Programming and Scripting

To Delete the repeated occurances and print in same line by appending values

Hi All, I am trying to work on below text a b c 1 a b c 2 a b c 3 x y z 6 x y z 44 a b c 89 Need to delete the occurances and get in single line like below: a b c 1 2 3 89 x y z 6 44 89 Please help me i am new into unix scripting ..... ---------- Post updated at 03:00... (8 Replies)
Discussion started by: shaliniyadav
8 Replies

5. Shell Programming and Scripting

Help in counting the no of repeated words with count in a file

Hi Pls help in solving my doubt.Iam having file like below file1.txt priya jenny jenny priya raj radhika priya bharti bharti Output required: I need a output like count of repeated words with name for ex: priya 3 jenny 2 (4 Replies)
Discussion started by: bha148
4 Replies

6. Shell Programming and Scripting

delete repeated strings (tags) in a line and concatenate corresponding words

Hello friends! Each line of my input file has this format: word<TAB>tag1<blankspace>lemma<TAB>tag2<blankspace>lemma ... <TAB>tag3<blankspace>lemma Of this file I need to eliminate all the repeated tags (of the same word) in a line, as in the example here below, but conserving both (all) the... (2 Replies)
Discussion started by: mjomba
2 Replies

7. Shell Programming and Scripting

New sequence nos to be added in new files

Hi All, Please help me in below request. Got multiple files in a dir ex: /os . from each file need to filter based upon first field (field only has 1,2,3 or 4) and then put it in different files based on the Field 1. But need to generate a sequence while inserting and the sequence number needs... (1 Reply)
Discussion started by: rdakshn
1 Replies

8. Shell Programming and Scripting

Find repeated word and take sum of the second field to it ,for all the repeated words in awk

Hi below is the input file, i need to find repeated words and sum up the values of it which is second field from the repeated work.Im trying but getting no where close to it.Kindly give me a hint on how to go about it Input fruits,apple,20,fruits,mango,20,veg,carrot,12,veg,raddish,30... (11 Replies)
Discussion started by: 100bees
11 Replies

9. Shell Programming and Scripting

Combination of 6 nos

Hi folks, I have a numbers from 1-100 and from these nos I have 30 numbers.. From this 30 nos, I have to generate a combination of 6 nos... this 30 numbers will range from 1-100... ( FYI: This is not a lottery game - just kidding) ... I am trying out this in a shell script.. any ideas ? (3 Replies)
Discussion started by: gsiva
3 Replies
cdc(1)							      General Commands Manual							    cdc(1)

Name
       cdc - change delta commentary of an SCCS file

Syntax
       cdc -rSID [-m[mrlist]]  [-y[comment]] files

Description
       The command changes the delta commentary of each named SCCS file, for the SID specified by the -r option.

       The  delta  commentary  is  defined to be the Modification Request (MR) and comment information usually specified by the command (-m and -y
       options).

       The commentary may consist of one or more lines, terminated by a dot in column one of a new line.

       If a directory is named, behaves as though each file in the directory were specified as a named file, except non-SCCS files (last component
       of the path name does not begin with s.)  and unreadable files, which are silently ignored.  If a name of - is given, the standard input is
       read (see RESTRICTIONS).  Each line of the standard input is taken to be the name of an SCCS file to be processed.

       Arguments to which may appear in any order, consist of option arguments, and file names.

       All the described option arguments apply independently to each named file.

Options
       -m[mrlist]     Adds or deletes modification numbers.  If the SCCS file has the v flag set then a list of MR  numbers  to  be  added  and/or
		      deleted  in the delta commentary of the SID specified by the -r option may be supplied.  For further information, see A null
		      MR list has no effect.

		      MR entries are added to the list of MRs in the same manner as that of In order to delete an MR, precede the MR  number  with
		      the  character  ! (see Examples).  If the MR to be deleted is currently in the list of MRs, it is removed and changed into a
		      comment line.  A list of all deleted MRs is placed in the comment section of the delta commentary and is preceded by a  com-
		      ment line stating that they were deleted.

		      If  -m  is not used and the standard input is a terminal, the prompt MRs?  is issued on the standard output before the stan-
		      dard input is read.  If the standard input is not a terminal, no prompt is issued.  The MRs? prompt always precedes the com-
		      ments? prompt (see -y option).
		      MRs in a list are separated by blanks and/or tab characters.  An unescaped new-line character terminates the MR list.

		      Note  that  if  the v flag has a value it is taken to be the name of a program (or shell procedure) which validates the cor-
		      rectness of the MR numbers.  For further information, see If a nonzero exit status is returned from the MR number validation
		      program, terminates and the delta commentary remains unchanged.

       -rSID	      Specifies the SCCS Identification string of a delta for which the delta commentary is to be changed.

       -y[comment]    Replaces	existing  commentary  for  the delta specified by the -r option.  The previous comments are kept and preceded by a
		      comment line stating that they were changed.  A null comment has no effect.

		      If -y is not specified and the standard input is a terminal, the prompt comments? is issued on the  standard  output  before
		      the standard input is read; if the standard input is not a terminal, no prompt is issued.  A dot in column one of a new line
		      terminates the comment text.

       Certain permissions are necessary to modify the SCCS file; generally, however, if you made the delta, you can change its delta  commentary,
       and if you own the file and directory you can modify the delta commentary.

Examples
       This example shows how to add bl78-12345 and bl79-00001 to the MR list, remove bl77-54321 from the MR list, and add the comment ``trouble''
       to delta 1.6 of s.file.
       sccscdc -r1.6 -m"bl78-12345 !bl77-54321 bl79-00001" -ytrouble .file

       This example does the same thing.
       sccscdc -r1.6 .file

       -MRs? !bl77-54321 bl78-12345 bl79-00001

       comments? trouble

Restrictions
       If SCCS file names are supplied to the command via the standard input (- on the command line), then the -m and  -y  options  must  also	be
       used.

Diagnostics
       See for explanations.

Files
       For more information, see

       For more information, see

See Also
       admin(1), delta(1), get(1), help(1), prs(1), sccs(1), sccsfile(5)
       Guide to the Source Code Control System

																	    cdc(1)
All times are GMT -4. The time now is 11:30 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy