10 More Discussions You Might Find Interesting
1. 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
2. UNIX for Dummies Questions & Answers
Hi,
I have a tab delimited text file where some lines have the string "NA" in the second column. For these lines, I want to replace NA with the value in the first column, the symbol underscore followed by the value in the fourth column. How do I go about doing that? Thanks!
Input:
1 ... (3 Replies)
Discussion started by: evelibertine
3 Replies
3. Shell Programming and Scripting
file content are like this
sam,22,29,23,24,25,26,22
i want to add the values from column 3 (fix column no) to as per user input say up to column 8 (variable as per user)
can we do this without using "awk" for each column (as number of columns are variable as per user input )
Thanks in... (5 Replies)
Discussion started by: sagar_1986
5 Replies
4. Shell Programming and Scripting
Hi,
I have n number of values like
1
2
3
4
I want the output like
1 2 3
4 5 6
- - -
- - -
Please help me on this:wall: (4 Replies)
Discussion started by: cns1710
4 Replies
5. Shell Programming and Scripting
Hi all
I am trying to scan a file that has 3 columns:
red blue 123351
red blue 848655
red blue 126354
red blue 023158
black white 654896
red blue 650884
I want an output that sums the rows that have matching columns 1 and 2 :wall:
red blue has 5 entries
black white has 1 entry
... (4 Replies)
Discussion started by: reno
4 Replies
6. UNIX for Dummies Questions & Answers
Hi there,
I am totally new to Unix, I am trying to work out the percentage between two values in a ksh shell script and assign the result to a variable.
Value1=577
Values2=244
So the calculation would be as follows:
((Value1 - Value2) / Value1) * 100
How would I be able to achieve... (2 Replies)
Discussion started by: NextLevelAndi
2 Replies
7. UNIX for Dummies Questions & Answers
Hi,
For each row in a file, i would like to identify the maximum value and calculate the percentage/fraction of the max for other values in the row.
Then, I would like to print a copy of the file where values above a threshold are replaced with "1" and other values are left as "0".
In the... (2 Replies)
Discussion started by: auburn
2 Replies
8. Shell Programming and Scripting
Does anybody understand why this is not being interpreted as true.
Script:
#!/bin/bash
errored=`grep "errored" new_update_scripts.txt`
echo $errored = "errored"
if ; then
echo true
else
echo false
fi
Output:
$ UpdateScripts
errored = errored
false (7 Replies)
Discussion started by: scottwmackey
7 Replies
9. Shell Programming and Scripting
Hi
I need to do some thing like "find and insert before that " in a file which contains many records. This will be clear with the following example.
The original data record should be some thing like this
60119827 RTMS_LOCATION_CDR INSTANT_POSITION_QUERY 1236574686123083rtmssrv7 ... (8 Replies)
Discussion started by: aemunathan
8 Replies
10. Shell Programming and Scripting
Hi, I am having the file which contains the following two columns.
518 _factorial
256 _main
73 _atol
52 ___do_global_ctors
170 ___main
52 ___do_g
How can calculate the percentage of each value in the first column ?
first need to get the sum of the first column and... (3 Replies)
Discussion started by: saleru_raja
3 Replies