01-16-2013
I don't understand what you're trying to do.
Are you saying that you have a comma separated file, but some lines have less than 5 commas and you want to know how many lines have at least one comma but less than 4 commas?
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
I have a file:
Fred
Fred
Fred
Jim
Fred
Jim
Jim
If sort is executed on the listed file, shouldn't the output be?:
Fred
Fred
Fred
Fred
Jim
Jim
Jim (3 Replies)
Discussion started by: jimmyflip
3 Replies
2. Shell Programming and Scripting
Input File is :
-------------
25060008,0040,03,
25136437,0030,03,
25069457,0040,02,
80303438,0014,03,1st
80321837,0009,03,1st
80321977,0009,03,1st
80341345,0007,03,1st
84176527,0047,03,1st
84176527,0047,03,
20000735,0018,03,1st
25060008,0040,03,
I am using the following in the script... (5 Replies)
Discussion started by: Amruta Pitkar
5 Replies
3. Shell Programming and Scripting
The key is first field i want only uniq record for the first field in file.
I want the output as
or output as
Appreciate help on this (4 Replies)
Discussion started by: pinnacle
4 Replies
4. Shell Programming and Scripting
Hello,
I have a large data file:
1234 8888 bbb
2745 8888 bbb
9489 8888 bbb
1234 8888 aaa
4838 8888 aaa
3977 8888 aaa
I need to remove duplicate lines (where the first column is the duplicate). I have been using:
sort file.txt | uniq -w4 > newfile.txt
However, it seems to keep the... (11 Replies)
Discussion started by: palex
11 Replies
5. Shell Programming and Scripting
Hello,
I have a log file with the following input:
X , ID , Date, Time, Y
01,01368,2010-12-02,09:07:00,Pass
01,01368,2010-12-02,10:54:00,Pass
01,01368,2010-12-02,13:07:04,Pass
01,01368,2010-12-02,18:54:01,Pass
01,01368,2010-12-03,09:02:00,Pass
01,01368,2010-12-03,13:53:00,Pass... (12 Replies)
Discussion started by: rollyah
12 Replies
6. Shell Programming and Scripting
Hi All,
I have a text file with the format shown below. Some of the records are duplicated with the only exception being date (Field 15). I want to compare all duplicate records using subscriber number (field 7) and keep only those records with greater date.
... (1 Reply)
Discussion started by: nua7
1 Replies
7. Shell Programming and Scripting
I have a flatfile A.txt
2012/12/04 14:06:07 |trees|Boards 2, 3|denver|mekong|mekong12
2012/12/04 17:07:22 |trees|Boards 2, 3|denver|mekong|mekong12
2012/12/04 17:13:27 |trees|Boards 2, 3|denver|mekong|mekong12
2012/12/04 14:07:39 |rain|Boards 1|tampa|merced|merced11
How do i sort and get... (3 Replies)
Discussion started by: sabercats
3 Replies
8. Shell Programming and Scripting
Hi !
I am trying to remove doubbled entrys in a textfile only between delimiters.
Like that example but i dont know how to do that with sort or similar.
input:
{
aaa
aaa
}
{
aaa
aaa
}
output:
{
aaa
}
{ (8 Replies)
Discussion started by: fugitivus
8 Replies
9. UNIX for Dummies Questions & Answers
Hello all,
Need to pick your brains,
I have a 10Gb file where each row is a name, I am expecting about 50 names in total. So there are a lot of repetitions in clusters.
So I want to do a
sort -u file
Will it be considerably faster or slower to use a uniq before piping it to sort... (3 Replies)
Discussion started by: senhia83
3 Replies
10. Shell Programming and Scripting
Hi All,
Below the actual file which i like to sort and Uniq -u
/opt/oracle/work/Antony/Shell_Script> cat emp.1st
2233|a.k. shukula |g.m. |sales |12/12/52 |6000
1006|chanchal singhvi |director |sales |03/09/38 |6700... (8 Replies)
Discussion started by: Antony Ankrose
8 Replies
LEARN ABOUT DEBIAN
vtprintcap
VTPRINTCAP(5) File Formats Manual VTPRINTCAP(5)
NAME
vtprintcap - database of terminal printer control codes
SYNOPSIS
/etc/vtprintcap
DESCRIPTION
vtprintcap is a simple flat file database containing a list of the names of various terminals and the codes those terminals use to start
and stop an attached printer (media hard copy). This database is used by vtprint(1) and related programs.
Each entry is composed of three lines. The first line is a comma-delimited list of names which may be used to reference this entry. The
second line the sequence of characters used by the terminal to turn on an attached hard copy device and redirect output to that device.
The third line contains the sequence of characters used to turn the device off and restore normal output to the screen.
An entry must have all three lines to be considered valid. Currently no comment lines are permitted to exist between these lines: such
lines would be interpreted as the printer control codes themselves!
The rules for selecting a terminal name are simple: you must follow the same rules as for /etc/termcap(5) names. Terminal names should be
entered in /etc/vtprintcap with exactly the same names as are in /etc/termcap.
The control code strings in the second and third lines of an entry are governed as follows: ANSI C style escapes for character constants
(e.g.
for newline) are permitted, constant strings are permitted, and quotes may be used to as delimiters in the string. (This is use-
ful if you wish you use a digit immediately following a numeric escape. For example, ESC-5 should be represented as 33"5" to avoid confu-
sion in with 335. In general, the rules outlined for ANSI constant escaping are enforced.
Additionally, /etc/vtprintcap may contain comment lines, which are indicated by placing a hash mark (#) in the first column of the line.
Remember however that entries must not be broken up by comment lines!
EXAMPLE
Here is a sample entry common to DEC vt100 and vt102 terminals:
# Sample vtprintcap entry for vt100 & vt102 terminals
vt100, vt102
33[5i
33[4i
This entry would be used whenever the user's TERM environment variable was set to "vt102" or "vt100", using ESC [5i and ESC [4i as the
printer control codes to turn a printer on and off, respectively.
DISTRIBUTION
vtprintcap is part of the vtprint package, which can be obtained by anonymous ftp at ftp.sdsu.edu in the /pub/vtprint directory. Please
read the INDEX and README files before downloading.
If you do not have ftp availability, then you can request a uuencoded copy of vtprint be sent to you via e-mail from the author. The
author is also willing to make other arrangements as needed, within certain limitations.
FILES
/etc/termcap
/etc/vtprintcap
BUGS
vtprintcap handling code currently could get confused if a printer control code is exactly the same as the name of a terminal, or contained
the name of a terminal delimited by commas. As this is very unlikely to every occur, it shouldn't be a problem.
SEE ALSO
termcap(5) vtprint(1)
vtprint v2.0.2 25 October 1994 VTPRINTCAP(5)