10 More Discussions You Might Find Interesting
1. UNIX for Beginners Questions & Answers
Hello,
I am writing a script which expects as its input a hash with student names as the keys and marks as the values. The script then returns array of average marks for student scored 60-70, 70-80, and over 90.
Output expected
50-70 1
70-90 3
over 90 0
The test script so far... (4 Replies)
Discussion started by: nans
4 Replies
2. Shell Programming and Scripting
Hello everyone,
I have a requirement as shown below. I need to delete consecutive same values from the source file and give it as output file.
Source:
a,b,c,d,e,e,f,g
Target:
a,b,c,d,f,g
The repeating value "e" should be deleted from the file completely. How can I achieve this... (14 Replies)
Discussion started by: vamsikrishna928
14 Replies
3. Shell Programming and Scripting
Hi I have a difficulty in writing shell script for performing the tasks.
A B C D
12 230 16 259
18 260 23 283
21 291 36 298
41 309 49 420
52 425 57 450
61 456 70 473
72 475 79 486
If the A(row no.2) < C(row no.1) then delete value A(row no.1) and so on...
For... (8 Replies)
Discussion started by: Sarwagya Jha
8 Replies
4. Shell Programming and Scripting
I have two questions that are related, so it would be great if you can help me with both!
Question1:
I have a file A that looks like this:
a x
b y
b z
c w
I want to get something like:
a x
b y; z
c w
Given that a,b,c has no spaces. But the other letters might contain spaces.
... (2 Replies)
Discussion started by: Viernes
2 Replies
5. Shell Programming and Scripting
Hello,
I have a very large file for which I would like to remove all rows for which the value of columns 2-5 is zero.
For instance I would like this file:
contig1, 0, 0, 0, 0
contig2, 1, 3, 5, 0
contig3, 0, 0, 0, 0
contig4, 0, 5, 6, 7
To become this file:
contig2, 1, 3, 5,0 ... (17 Replies)
Discussion started by: mouchkam
17 Replies
6. UNIX for Dummies Questions & Answers
I have some junk values in my files
鵶„‰¼±¤¡ad. am able to find the octal values as below by using od command.
303 251 265 266 204 211 274 261 244 241 141 144
i want to know how to delete the octal this values . (5 Replies)
Discussion started by: vino.paal
5 Replies
7. Shell Programming and Scripting
Hi Guyz
The 1st column of the input file has repeated keys like x,y and z.
The ist task is if the 1st column has unique key (say x) and then need to consider 4th column, if it is + symbol then subtract 2nd column value with 3rd column value (we will get 2(10-8)) or if it is - symbol subtract 3rd... (3 Replies)
Discussion started by: repinementer
3 Replies
8. Shell Programming and Scripting
HI
The input 1st column has specific keys like 1 with value a,b and c. 2 with b,b,d and 3 with a,a a.
when ever c appears as one of the values the result will be key ........ c (You can see in the out put as 1 w...... 6.... c) and same follows for d.
Thanx:)
I'm learning awk scripting. If... (3 Replies)
Discussion started by: repinementer
3 Replies
9. Shell Programming and Scripting
I have a file with 3 columns
2 4 5
2 4 7
3 5 7
4 -6 9
5 -9 4
6 -3 3
Bascially I want to delete the entire row if column 2 is a "-"
So the end result will be
2 4 5
2 4 7
3 5 7
I have trouble doing this cause of the - in front of the number.
thanks (2 Replies)
Discussion started by: kylle345
2 Replies
10. Shell Programming and Scripting
Hi guyz I have been using this script to find similar keys in 2 files and merge the keys along with their values. Therefore it prints similar keys by leaving dissimilar. Any one knows how to print only Dissimilar leaving Similar.
Help would be appreciated.
The script I'm using for similar... (4 Replies)
Discussion started by: repinementer
4 Replies