10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I've been struggling with this one for quite a while and cannot seem to find a solution for this find/replace scenario. Perhaps I'm getting rusty.
I have a file that contains a number of metrics (exactly 3 fields per line) from a few appliances that are collected in parallel. To identify the... (3 Replies)
Discussion started by: verdepollo
3 Replies
2. Shell Programming and Scripting
I have a file is created from standard output.
I have put a leading space to force the first line to collate low vis a vis the rest of the lines.
If I pass the entire file to the Linux sort, it ignores the leading space and the first line appears in somewhere in the list.
If I add lots of... (15 Replies)
Discussion started by: lsatenstein
15 Replies
3. Shell Programming and Scripting
I have an output file .dat. From this file i have to do a distinct of the ID using the sort uniq command in bash script. How can i do it? i found :
sort -u ${FILEOUT_DAT}
but i don't think is my solution because the id isn't specified.. is there other solution? (7 Replies)
Discussion started by: punticci
7 Replies
4. Shell Programming and Scripting
Hi All,
I am trying write a simple command using AWK and SED to this but without any success.
Here is what I am using:
head -1 test1.txt>test2.txt|sed '1d;$d' test1.txt|awk '{print substr($0,0,(length($0)-2))}' >>test2.txt|tail -1 test1.txt>>test2.txt
Input:
Header
1234567
abcdefgh... (2 Replies)
Discussion started by: nvuradi
2 Replies
5. UNIX for Dummies Questions & Answers
How to sort a tab delimited file first on col1 and then on col2. Also I need to keep the header intact.
file.txt
val1 val2 val3 val4
a b c d
m n o p
e f g h
i j k l
... (3 Replies)
Discussion started by: mary271
3 Replies
6. UNIX for Advanced & Expert Users
I have a file with list of redundant server names and want only unique ones of those.
I have used following command but still redudant ones are listing
$cat file|sort|uniq
where could be the problem.
Thanks,
Srinivas (3 Replies)
Discussion started by: srinivas Juluri
3 Replies
7. Shell Programming and Scripting
Hi,
I have a file with a header line, followed by some contents. How can I sort the file according to header lines?
eg.
/* abcd_005*/
a
bc
/* abcd_001*/
d
e
/* abcd_002*/
x
y
desired output:
/*abcd_001*/ (0 Replies)
Discussion started by: neil.0412
0 Replies
8. UNIX for Dummies Questions & Answers
Hello all, new to unix and have just found the forum.
I think I will be here quite often, and hope that in time i will be able to provide soem help, role on not being a newbie anymore :)
I have a question which iI am hoping someone could help me with.
If i have a file with lines in in thus... (8 Replies)
Discussion started by: grom
8 Replies
9. UNIX for Dummies Questions & Answers
Hello all,
I've got a strange behaviour of sort and uniq commands: they do not recognise apparently duplicated lines in a file (already sorted). The lines are identical by eye, but they must differ in smth, because when they are put in two files, those have slightly different size.
What can make... (8 Replies)
Discussion started by: roussine
8 Replies
10. Shell Programming and Scripting
Do somebody have idea How to sort standard input without first line which in my case it's header
Example:
Cnt|VT |STAT|Date |Time |From |Alert Message |Instance |
125| | | 260308 |160026 |ZAMUAT2|ifpollq... (8 Replies)
Discussion started by: pp56825
8 Replies