10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
As part of some report generation, I've written a script to fetch the values from DB. But, unluckily, for certain Time ranges(1-9.99,10-19.99 etc), I don't have data in DB.
In such cases, I would like to write zero (0) instead of empty. The desired output will be exported to csv file.
... (1 Reply)
Discussion started by: kumar_karpuram
1 Replies
2. Shell Programming and Scripting
Hi,
I am trying to transpose rows to columns for thousands of records. The problem is there are records that have the same lines that need to be separated. the input file as below:-
ID 1A02_HUMAN
AC P01892; O19619; P06338; P10313; P30444; P30445; P30446; P30514;
AC Q29680; Q29837;... (2 Replies)
Discussion started by: redse171
2 Replies
3. Shell Programming and Scripting
Hi,
I've got as far as this: awk '{sum+=$1}(NR%3==1){avg=sum/3; print avg}' input.txt
Input it:
0.1
txt
txt
0.2
txt
txt
0.3
txt
txt
So, the I get the results:
0.0333333
0.133333
0.2 (8 Replies)
Discussion started by: JohnnyEnglish
8 Replies
4. Shell Programming and Scripting
Hi,
I have file with values as below
1~ab~456~ac:bd:de:ef~yyyy-mm-dd
2~cd~458~af:fg:ty:er:ty:uj:io:~yyyy-mm-dd
I want the o/p as for frist row
1~ab~456~ac~yyyy-mm-dd
1~ab~456~bd~yyyy-mm-dd
1~ab~456~de~yyyy-mm-dd
1~ab~456~ef~yyyy-mm-dd
and for the second row
2~cd~458~af~yyyy-mm-dd... (4 Replies)
Discussion started by: rithushri
4 Replies
5. Shell Programming and Scripting
Is there a way to tell diff to show differences one line at a time and not to group them? For example, I have two files:
file1:
line 1
line 2
line 3 diff
line 4 diff
line 5 diff
line 6
line 7
file2:
line 1
line 2
line 3 diff.
line 4 diff.
line 5 diff.
line 6
line 7 (13 Replies)
Discussion started by: mmr11408
13 Replies
6. Shell Programming and Scripting
I am a new user of Unix/Linux, so this question might be a bit simple!
I am trying to join two (very large) files that both have different # of cols and rows in each file.
I want to keep 'all' rows and 'all' cols from both files in the joint file, and the primary key variables are in the rows.... (1 Reply)
Discussion started by: BNasir
1 Replies
7. Shell Programming and Scripting
Hi,
How can i use AWK or any other commands to find the difference between 2 files.
File A
aaa
bbb
ccc
111
222
File B
aaa
ccc
111
Output
bbb
222 (6 Replies)
Discussion started by: gambit97
6 Replies
8. Shell Programming and Scripting
Hi,
When I run the diff command using diff -yt file1 file2, I get the output in which original lines are truncated.
I tried using -W switch with diff. However, that does not produce exact output as I want. Is it possible to show entire line of file1 and file2 in diff command's output?
... (8 Replies)
Discussion started by: jal_capri
8 Replies
9. Shell Programming and Scripting
I have a large file (10M lines) that contains two columns: a frequency and a string, ex:
3 aaaaa
4 bbbbb
2 ccccc
5 aaaaa
1 ddddd
4 ccccc
I need to merge the lines whose string part is the same, while updating the frequency. The output should look like this:
8 aaaaa
4 bbbbb
5 ccccc... (2 Replies)
Discussion started by: tootles564
2 Replies
10. UNIX for Dummies Questions & Answers
hi
i have data which is in two columns (such as below). i need to compare two rows against each other and if one row matches the other row (except for different case), and their values in the second column are different, then it prints out one of the rows (either is fine).
here is an... (5 Replies)
Discussion started by: Streetrcr
5 Replies