Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Print unique lines without sort or unique Post 302853515 by Scott on Saturday 14th of September 2013 08:07:00 PM
Old 09-14-2013
Those missing programs are core utilities. Why would they be missing? Which OS is this?
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

get part of file with unique & non-unique string

I have an archive file that holds a batch of statements. I would like to be able to extract a certain statement based on the unique customer # (ie. 123456). The end for each statement is noted by "ENDSTM". I can find the line number for the beginning of the statement section with sed. ... (5 Replies)
Discussion started by: andrewsc
5 Replies

2. Shell Programming and Scripting

Awk sort and unique

Input file --------- 12:name1:|host1|host1|host2|host1 13:name2:|host1|host1|host2|host3 14:name3: ...... Required output --------------- 12:name1:host1(2)|host1(1) 13:name2:host1(2)|host2(1)|host3(1) 14:name3: where (x) - Count how many times field appears in last column ... (3 Replies)
Discussion started by: greycells
3 Replies

3. Shell Programming and Scripting

Unique sort with two fields

I have a file with contents below 123,502 123,506 123,702 234,101 235,104 456,104 456,100 i want to sort such that i get a unique value in column A, and for those with multiple value in A, i want the lowest value in B. output should be 123,502 234,101 235,104 456,100 (3 Replies)
Discussion started by: dealerso
3 Replies

4. Shell Programming and Scripting

Compare Tab Separated Field with AWK to all and print lines of unique fields.

Hi. I have a tab separated file that has a couple nearly identical lines. When doing: sort file | uniq > file.new It passes through the nearly identical lines because, well, they still are unique. a) I want to look only at field x for uniqueness and if the content in field x is the... (1 Reply)
Discussion started by: rocket_dog
1 Replies

5. Shell Programming and Scripting

Compare multiple files and print unique lines

Hi friends, I have multiple files. For now, let's say I have two of the following style cat 1.txt cat 2.txt output.txt Please note that my files are not sorted and in the output file I need another extra column that says the file from which it is coming. I have more than 100... (19 Replies)
Discussion started by: jacobs.smith
19 Replies

6. Shell Programming and Scripting

Change unique file names into new unique filenames

I have 84 files with the following names splitseqs.1, spliseqs.2 etc. and I want to change the .number to a unique filename. E.g. change splitseqs.1 into splitseqs.7114_1#24 and change spliseqs.2 into splitseqs.7067_2#4 So all the current file names are unique, so are the new file names.... (1 Reply)
Discussion started by: avonm
1 Replies

7. Shell Programming and Scripting

Print lines in which value in specified Col is NOT unique

Hi everyone, I have the following file, which is a 3 column tab-delineated. cat big 24 cat small 13 cat red 63 dog big 34 chicken plays 39 fish red 294 I would like to print only those lines, in which the value in Col2 is repeated. Thus, given the above input file, the desired... (7 Replies)
Discussion started by: owwow14
7 Replies

8. Shell Programming and Scripting

Sort unique

Hi, I have an input file that I have sorted in a previous stage by $1 and $4. I now need something that will take the first record from each group of data based on the key being $1 Input file 1000AAA|"ZZZ"|"Date"|"1"|"Y"|"ABC"|""|AA 1000AAA|"ZZZ"|"Date"|"2"|"Y"|"ABC"|""|AA... (2 Replies)
Discussion started by: Ads89
2 Replies

9. UNIX for Beginners Questions & Answers

Print lines based upon unique values in Nth field

For some reason I am having difficulty performing what should be a fairly easy task. I would like to print lines of a file that have a unique value in the first field. For example, I have a large data-set with the following excerpt: PS003,001 MZMWR/ L-DWD// * PS003,001... (4 Replies)
Discussion started by: jvoot
4 Replies

10. UNIX for Beginners Questions & Answers

Print number of lines for files in directory, also print number of unique lines

I have a directory of files, I can show the number of lines in each file and order them from lowest to highest with: wc -l *|sort 15263 Image.txt 16401 reference.txt 40459 richtexteditor.txt How can I also print the number of unique lines in each file? 15263 1401 Image.txt 16401... (15 Replies)
Discussion started by: spacegoose
15 Replies
cdk_params(3)						     Library Functions Manual						     cdk_params(3)

NAME
cdk_params - Cdk command-line parsing SYNOPSIS
cc [ flag ... ] file ... -lcdk [ library ... ] #include <cdk.h> int CDKparamNumber ( CDK_PARAMS *params, int option); int CDKparamNumber2 ( CDK_PARAMS *params, int option, int missing); char * CDKparamString ( CDK_PARAMS *params, int option); char * CDKparamString2 ( CDK_PARAMS *params, int option, char *missing); void CDKparseParams ( int argc, char **argv, CDK_PARAMS *params, char *options); int CDKparsePosition ( char *string); int CDKparamValue ( CDK_PARAMS * params, int option, int missing); DESCRIPTION
These are a set of functions used to implement the command-line utilities and demonstration programs for Cdk. Rather than set the pro- grams' options at initialization, they construct a simple database which holds the common parameters using CDKparseParams(). AVAILABLE FUNCTIONS
CDKparamNumber Retrieves an integer (or boolean) option value from the parsed command-line. CDKparamNumber2 Retrieves an optional integer (or boolean) value from the parsed command-line. If the command line option is not present, the missing value is used. CDKparamString Retrieves a string option value from the parsed command-line. CDKparamString2 Retrieve an optional string option value from the parsed command-line. CDKparamValue Retrieve an integer (or boolean) option value from the parsed command-line. CDKparseParams Parse the given argc/argv command-line, with the options passed to getopt()'s 3rd parameter. CDKparsePosition Parse the string as one of CDK's positioning keywords, or an actual position. SEE ALSO
cdk_position (3), getopt (3) cdk_params(3)
All times are GMT -4. The time now is 03:57 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy