03-21-2011
This worked perfectly with the \t introduced in the new code ...... yeah my fields are separated by tabs .... awesome stuff Bartus11 ... once again if you clould please break the code down and comment on it, will make things simpler for me to understand and apply elsewhere
this code has a special <=> operator .... what does this do ??
Thank you very much again ... hv a nice evening
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hello,
I have a bash shell script and I use awk to print certain columns of one file and direct the output to another file. If I do a less or cat on the file it looks correct, but if I email the file and open it with Outlook the lines outputted by awk are concatenated.
Here is my awk line:... (6 Replies)
Discussion started by: xadamz23
6 Replies
2. Shell Programming and Scripting
Hi,
I have 2 files
file1
********
01-05-09|java.xls|
02-05-08|c.txt|
08-01-09|perl.txt|
01-01-09|oracle.txt|
********
file2
********
01-02-09|windows.xls|
02-05-08|c.txt|
01-05-09|java.xls|
08-02-09|perl.txt|
01-01-09|oracle.txt|
******** (8 Replies)
Discussion started by: shekhar_v4
8 Replies
3. UNIX for Advanced & Expert Users
Hi All,
I have a very huge file (4GB) which has duplicate lines. I want to delete duplicate lines leaving unique lines. Sort, uniq, awk '!x++' are not working as its running out of buffer space.
I dont know if this works : I want to read each line of the File in a For Loop, and want to... (16 Replies)
Discussion started by: krishnix
16 Replies
4. Shell Programming and Scripting
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
5. UNIX for Dummies Questions & Answers
hi
i have used comm -13 <(sort 1.txt) <(sort 2.txt) option to get the unique lines that are present in file 2 but not in file 1. but some how i am getting the entire file 2. i would expect few but not all uncommon lines fro my dat. is there anything wrong with the way i used the command?
my... (1 Reply)
Discussion started by: anurupa777
1 Replies
6. Shell Programming and Scripting
hi
my problem is little complicated one. i have 2 files which appear like this
file 1
abbsss:aa:22:34:as akl abc 1234
mkilll:as:ss:23:qs asc abc 0987
mlopii:cd:wq:24:as asd abc 7866
file2
lkoaa:as:24:32:sa alk abc 3245
lkmo:as:34:43:qs qsa abc 0987
kloia:ds:45:56:sa acq abc 7805
i... (5 Replies)
Discussion started by: anurupa777
5 Replies
7. Shell Programming and Scripting
Hello everyone,
Maybe somebody could help me with an awk script.
I have this input (field separator is comma ","):
547894982,M|N|J,U|Q|P,98,101,0,1,1
234900027,M|N|J,U|Q|P,98,101,0,1,1
234900023,M|N|J,U|Q|P,98,54,3,1,1
234900028,M|H|J,S|Q|P,98,101,0,1,1
234900030,M|N|J,U|F|P,98,101,0,1,1... (2 Replies)
Discussion started by: Ophiuchus
2 Replies
8. Shell Programming and Scripting
file 1
Sun Mar 17 00:01:33 2013 submit , Name="1234"
Sun Mar 17 00:01:33 2013 submit , Name="1344"
Sun Mar 17 00:01:33 2013 submit , Name="1124"
..
..
..
..
Sun Mar 17 00:01:33 2013 submit , Name="8901"
file 2
Sun Mar 17 00:02:47 2013 1234 execute SUCCEEDED
Sun Mar 17... (24 Replies)
Discussion started by: aravindj80
24 Replies
9. UNIX for Dummies Questions & Answers
I would like to print unique lines without sort or unique. Unfortunately the server I am working on does not have sort or unique. I have not been able to contact the administrator of the server to ask him to add it for several weeks. (7 Replies)
Discussion started by: cokedude
7 Replies
10. 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
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
fspec(4) Kernel Interfaces Manual fspec(4)
NAME
fspec - format specification in text files
DESCRIPTION
It is sometimes convenient to maintain text files on the HP-UX system with non-standard tabs, (meaning tabs that are not set at every
eighth column). Generally, such files must be converted to a standard format - frequently by replacing all tabs with the appropriate num-
ber of spaces - before they can be processed by HP-UX system commands. A format specification occurring in the first line of a text file
specifies how tabs are to be expanded in the remainder of the file.
A format specification consists of a sequence of parameters separated by blanks and surrounded by the brackets and Each parameter consists
of a keyletter, possibly followed immediately by a value. The following parameters are recognized:
The parameter specifies tab settings for the file. The value of tabs must be one of the following:
1. A list of column numbers separated by commas, indicating tabs set at the specified columns;
2. A followed immediately by an integer n, indicating tabs at intervals of n columns;
3. A followed by the name of a ``canned'' tab specification.
Standard tabs are specified by or equivalently, etc. Recognized canned tabs are defined by the command (see
tabs(1)).
The parameter specifies a maximum line size. The value of size must be an integer. Size checking is performed after
tabs have been expanded, but before the margin is inserted at the beginning of the line.
The parameter specifies a number of spaces to be inserted at the beginning of each line. The value of margin must be an
integer.
The parameter takes no value. Its presence indicates that the line containing the format specification is to be deleted
from the converted file.
The parameter takes no value. Its presence indicates that the current format is to prevail only until another format
specification is encountered in the file.
Default values (assumed for parameters not supplied) are and If the parameter is not specified, no size checking is performed. If the
first line of a file does not contain a format specification, the above defaults are assumed for the entire file. The following is an
example of a line containing a format specification:
If a format specification can be disguised as a comment, it is not necessary to code the parameter.
Several HP-UX system commands correctly interpret the format specification for a file. Among them is which can be used to convert files to
a standard format acceptable to other HP-UX system commands.
SEE ALSO
ed(1), newform(1), tabs(1).
fspec(4)