10 More Discussions You Might Find Interesting
1. UNIX for Beginners Questions & Answers
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
How can I also print the number of unique lines in each file?
15263 1401 Image.txt
16401... (15 Replies)
Discussion started by: spacegoose
2. UNIX for Beginners Questions & Answers
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
3. Shell Programming and Scripting
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
1000AAA|"ZZZ"|"Date"|"2"|"Y"|"ABC"|""|AA... (2 Replies)
Discussion started by: Ads89
4. Shell Programming and Scripting
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
5. Shell Programming and Scripting
I have 84 files with the following names splitseqs.1, spliseqs.2 etc.
and I want to change the .number to a unique filename.
change splitseqs.1 into splitseqs.7114_1#24
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
6. Shell Programming and Scripting
I have multiple files. For now, let's say I have two of the following style
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
7. Shell Programming and Scripting
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.
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
8. Shell Programming and Scripting
I have a file with contents below
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
456,100 (3 Replies)
Discussion started by: dealerso
9. Shell Programming and Scripting
where (x) - Count how many times field appears in last column
... (3 Replies)
Discussion started by: greycells
10. Shell Programming and Scripting
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
Tk_GetUid(3) Tk Library Procedures Tk_GetUid(3)
Tk_GetUid, Tk_Uid - convert from string to unique identifier
char *string (in) String for which the corresponding unique identifier is desired.
Tk_GetUid returns the unique identifier corresponding to string. Unique identifiers are similar to atoms in Lisp, and are used in Tk to
speed up comparisons and searches. A unique identifier (type Tk_Uid) is a string pointer and may be used anywhere that a variable of type
"char *" could be used. However, there is guaranteed to be exactly one unique identifier for any given string value. If Tk_GetUid is
called twice, once with string a and once with string b, and if a and b have the same string value (strcmp(a, b) == 0), then Tk_GetUid will
return exactly the same Tk_Uid value for each call (Tk_GetUid(a) == Tk_GetUid(b)). This means that variables of type Tk_Uid may be com-
pared directly (x == y) without having to call strcmp. In addition, the return value from Tk_GetUid will have the same string value as its
argument (strcmp(Tk_GetUid(a), a) == 0).
atom, unique identifier