10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Hi,
For example:
I have:
HostA,XYZ
HostB,XYZ
HostC,ABC
I would like the output to be:
HostA,HostB: XYZ
HostC:ABC
How can I achieve this?
So far what I though of is: (1 Reply)
Discussion started by: alvinoo
1 Replies
2. Shell Programming and Scripting
Hi all!
I have 10.000 files having generally this format:
text text text
text num text num text num
text text text GAP number text text
text num text num text num RMS num
text num text num text num
...
what I want is to copy the files if the GAP number is lower than a value e.g. <100... (5 Replies)
Discussion started by: phaethon
5 Replies
3. Shell Programming and Scripting
I've got a file that looks like this (the whitespace between commas is intentional):
123456789,12,JOHN H DOE ,DOE/JOHN H ,,,DOE/JOHN H ,,,,,123 FAKE STREET ,SPRINGFIELD,XX,
I want to strip just the first name out of the third field so it reads "JOHN,". So far I... (6 Replies)
Discussion started by: Scottie1954
6 Replies
4. Shell Programming and Scripting
(7 Replies)
Discussion started by: newbie2010
7 Replies
5. Shell Programming and Scripting
Hi,
I have a file (sorted by sort) with 8 tab delimited columns. The first column contains duplicated fields and I need to merge all these identical lines.
My input file:
comp100002 aaa bbb ccc ddd eee fff ggg
comp100003 aba aba aba aba aba aba aba
comp100003 fff fff fff fff fff fff fff... (5 Replies)
Discussion started by: falcox
5 Replies
6. Shell Programming and Scripting
Hi All,
I have a text file with three columns. I would like a simple script that removes lines in which column 1 has duplicate entries, but use the largest value in column 3 to decide which one to keep. For example:
Input file:
12345a rerere.rerere len=23
11111c fsdfdf.dfsdfdsf len=33 ... (3 Replies)
Discussion started by: anniecarv
3 Replies
7. Shell Programming and Scripting
need a one liner to compare 2nd and 3rd field and print values that are not matched in 2nd field
Input
col 2 col 3
1.1.1.1 11.11.11.11
8.8.8.8 0.0.0.0
3.3.3.3 2.2.2.2
7.7.7.7 3.3.3.3
5.5.5.5 1.1.1.1
4.4.4.4
6.6.6.6
9.9.9.9
output
7.7.7.7 ... (12 Replies)
Discussion started by: chidori
12 Replies
8. Shell Programming and Scripting
java....4059... compsite 62u IPv4 170747 TCP *:9400 (LISTEN)
java...... 05... compsite 109u IPv4 171216 TCP *:9401 (LISTEN)
This is Joust formated like this
Please Repace "." with space" "
All are Right Justfied
Output :- 4058 and 05 so that i can kill this (1 Reply)
Discussion started by: pareshpatra
1 Replies
9. Shell Programming and Scripting
I want to sort alphabetically on the first field and sort in descending numerical order on the 2nd field. With a normal "sort -r -n" it does this:
abc ||| 5e-05 ||| bla
abc ||| 3 ||| ble
def ||| 1 ||| abc
def ||| 0.2 ||| def
As you can see it ignores the fact that 5e-05 is actually 0.00005... (1 Reply)
Discussion started by: FrancoisCN
1 Replies
10. Shell Programming and Scripting
I got a sample file like this.
$ cat test
12|13|100|s
12|13|100|s
100|13|100|s
12|13|100|s
I want to replace all 100 by 2000 only in 3rd field using "awk"
This is replacing all 100's :-(
$ awk -F "|" '{gsub( /100/,"2000");print}' test
12|13|2000|s
12|13|2000|s
2000|13|2000|s... (5 Replies)
Discussion started by: jkl_jkl
5 Replies