10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
hai guys,
pick the 1st field and calculate max length.
if suppose max length is 2,
then compare the all records if <2 then add zero's prefix of the record.
for ex:
s.no,sname
1,djud
37,jtuhe
in this max length of the 1st field is 2 right
the output wil be
s.no,sname
01,djud... (6 Replies)
Discussion started by: Suneelbabu.etl
6 Replies
2. UNIX for Dummies Questions & Answers
Hi folks,
I am very new to awk. I have what is probably a very simple question. I'm trying to get the max value of column 1, but also print column 2. My data looks like this:
0.044|2000-02-03 14:00:00
5.23|2000-02-03 05:45:00
5.26|2000-02-03 11:15:00
0|2000-02-01 18:30:00
So in this case... (2 Replies)
Discussion started by: amandarobe
2 Replies
3. Shell Programming and Scripting
Hi All,
I am searching for a script which will produce an output file with the uniq first field with the second field having highest value among all the duplicates..
The output file will produce only the uniqs which are duplicate 3 times..
Input file
X 9
B 5
A 1
Z 9
T 4
C 9
A 4... (13 Replies)
Discussion started by: ailnilanjan
13 Replies
4. Shell Programming and Scripting
I have an input that looks like this:
chr1 mm9_knownGene utr3 3204563 3206102 0 - . gene_id "Xkr4"; transcript_id "uc007aeu.1";
chr1 mm9_knownGene utr3 4280927 4283061 0 - . gene_id "Rp1"; transcript_id "uc007aew.1";
chr1 mm9_knownGene ... (5 Replies)
Discussion started by: pbluescript
5 Replies
5. Shell Programming and Scripting
Hello,
Is there anyway that I can align a pipe delimited text file by the maxium field length where the field is separated out by pipes for large text files with more than
100,000 rows?
So, far I have searched other forums and google about aligning text files in unix and I have noticed that... (7 Replies)
Discussion started by: physalis2099
7 Replies
6. Shell Programming and Scripting
Hello,
I'm trying to only print out the file systems that are greater than 90% full.
So far I've got:
df -k >sawky8
cat sawky8 | grep -v Filesystem | sed "s/%//g;" >sawky9
cat sawky9 | awk '{print $4}' | read stot
print $stot
if ;then
echo $LINE
Problem is it stops after the first... (2 Replies)
Discussion started by: Grueben
2 Replies
7. UNIX for Advanced & Expert Users
Hello,
I had posted earlier about printing fields using AWK, but now I have a slightly different problem. I have text files in the format:
1*2,3,4,5
and wish to print the first, third, and fifth fields, including the asterisk and commas. In other words, after filtering it should look... (1 Reply)
Discussion started by: Jahn
1 Replies
8. UNIX for Dummies Questions & Answers
hi, i have an awk script and I managed to figure out how to search the max value but Im having difficulty in searching for the min field value.
BEGIN {FS=","; max=0}
NF == 7 {if (max < $6) max = $6;}
END { print man, min}
where $6 is the column of a field separated by a comma (3 Replies)
Discussion started by: Kirichiko
3 Replies
9. Shell Programming and Scripting
Hi all,
Can anybody think of a way to do this? I have a file with content like the following:
F_TOP_PARAM_VALUEF_TOP_SOURCEF_TOP_DEL_NOTIFICATIONF_DEST_ADDRF_TOP_DEL_TYPE
What I want to do is print out the value in the square brackets after F_TOP_SOURCE. So in this case I'd like to print... (4 Replies)
Discussion started by: Donkey25
4 Replies
10. Shell Programming and Scripting
in csh
set x = "/home/usr/dir1/file1"
if i do:
echo $x | awk -F\/ '{print $NF}'
will result to:
"file1"
how do i invert the output to:
"/home/usr/dir1"
:confused: (2 Replies)
Discussion started by: jehrome_rando
2 Replies