10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Greetings. I have a three column file, and there are some numbers in the second column that are <1. However I need all numbers to be positive, thus need to replace all those numbers with just one. I feel like there must be a simple way to use awk to find these numbers and sed to replace but can't... (5 Replies)
Discussion started by: Twinklefingers
5 Replies
2. Shell Programming and Scripting
input
1 2 3 4 5 2 8
2 1 1 1 4 2 1
5 4 4 4 2 1 3
2 2 6 7 4 5 4
5 5 5 4 3 3 5
I woud like to print a min of each row such that my output would look like
1
1
1
2
3 (5 Replies)
Discussion started by: johnkim0806
5 Replies
3. Shell Programming and Scripting
Hi Friends,
my input file is this way
chr1 100 120 abc
chr1 100 121 def
chr1 100 122 ghi
chr2 240 263 kil
chr2 240 276 ghj
chr2 255 290 hjh
my output
chr1 100 122 abc
chr2 240 276 kil
chr2 255 290 hjh
Basically, I want to match on first and second column and then print the... (4 Replies)
Discussion started by: jacobs.smith
4 Replies
4. Linux
Please help me, wasted hrs:wall:, to find this soulution:-
I need a command that will work on file (xml) and replace multiple occurrence (more than 2 times)
Examples
1. '==='
2. '===='
3. '======='
should be replaced by just '=='
Note :- single character should be replaced. (=... (13 Replies)
Discussion started by: RedRocks!!
13 Replies
5. Shell Programming and Scripting
Hi All,
I am having a file which contains negative numbers, wht i am doing is re-formattting the file(moving few columns and add few hard codings between), while reformatting i would want the negative numbers to have the sign as trailing rather than leading.
Existing
-2400.00
34
0.00... (11 Replies)
Discussion started by: selvankj
11 Replies
6. UNIX for Dummies Questions & Answers
Hi.
I would like to ask for helps on extracting a minimum values among three columns using gawk in tab separator.
input file:
as1 10 20 30
as2 22 21 23
as3 300 391 567
as4 19 20 15
Output file:
as1 10
as2 21
as3 300
as4 15
I am extremely appreciate your helps and comments.... (2 Replies)
Discussion started by: Amanda Low
2 Replies
7. Programming
Hello there.
I've got the query like that
SELECT count(tour_id) AS cnt
FROM orders
JOIN tours
ON orders.tour_id=tours.id
GROUP BY tour_id
The result Is
cnt
1
4
2
1
1
Now i have to select all records with minimum values in field "cnt"
MySQL function min() returns only one.... (2 Replies)
Discussion started by: Trump
2 Replies
8. Shell Programming and Scripting
I have file which as 12 columns and values like this
1,2,3,4,5
a,b,c,d,e
b,c,a,e,f
a,b,e,a,h
if you see the first column has duplicate values, I need to identify (print it to console) the duplicate value (which is 'a') and also remove duplicate values like below. I could be in two... (5 Replies)
Discussion started by: nuthalapati
5 Replies
9. Shell Programming and Scripting
Hi All,
Consider the file with following lines:
1,2,3,4
1,2,3,
5,6,7,7,8,9
1
I need to get the count of minimum columns per line. i.e. in above case, it should come out to be 1 since the last line only has 1 column.
I tried following code:
minCount = 0
wordCountPerLine = 0... (12 Replies)
Discussion started by: sh_kk
12 Replies
10. Shell Programming and Scripting
Here is an example of a file I am working with:
C 4704 CB 1318 ASP 115 BGRF 1 weak 0.0% 4.33
C 4720 OD 1322 ASP 115 BGRF 1 weak 0.0% 3.71
O 4723 OD 1322 ASP 115 BGRF 1 weak 0.0% 3.48
O 4723 CG 1321 ASP 115 BGRF 1 weak 0.0% 4.34... (3 Replies)
Discussion started by: userix
3 Replies