10 More Discussions You Might Find Interesting
1. UNIX for Beginners Questions & Answers
Hi,
I have 2 files, I need to use column of file1 and do a comparison on file2 column 1 and print the mismatch is file3 as mentioned below.
Kindly consider that file 1 is having uniq key(column) whereas in file2 we have multiple duplicates (like 44). These duplicates should not come in... (2 Replies)
Discussion started by: grv
2 Replies
2. Shell Programming and Scripting
Hi , Need help, p
for value in `awk -F, '{print $1 }' ad | uniq`
do
x=$(echo $value)
echo $x
echo `awk -F, '{if( $1 == $x) sum = sum + $8 } END{print sum}' ad` --- not working
echo `awk -F, '{if($1 == “MT”) sum = sum + $8 } END{print sum}' ad` -- Working but hard coded
done;
ad... (4 Replies)
Discussion started by: nadeemrafikhan
4 Replies
3. Shell Programming and Scripting
Am using a find command in my script .The output may be one or more. I need to store those values in a array and need to access those. Am unable to find the solution . Any help on this will be helpful.
if
< code>
else a=<find command output which gives the file name either 1 or more>
if 1... (1 Reply)
Discussion started by: rogerben
1 Replies
4. Shell Programming and Scripting
Hello experts,
I'm stuck with this script for three days now. Here's what i need.
I need to split a large delimited (,) file into 2 files based on the value present in the last field.
Samp: Something.csv
bca,adc,asdf,123,12C
bca,adc,asdf,123,13C
def,adc,asdf,123,12A
I need this split... (6 Replies)
Discussion started by: shell_boy23
6 Replies
5. Shell Programming and Scripting
So, I'm making a little awk script that generates a range-based histogram of a set of numbers. I've stumbled onto a strange thing. Toward the end of the process, I have this test:
if ( bindex < s )
"bindex" is the "index" of my "bin" (the array element that gets incremented whenever a... (2 Replies)
Discussion started by: treesloth
2 Replies
6. Shell Programming and Scripting
Hi all,
i have a data array as follows.
array=ertfgj2345
array=456ttygkd
.
.
.
array=errdjt3235
so number or elements in the array can varies depending on how big the data input is.
now i have a variable, and it is $1 (there are $2, $3 and so on, i am only interested in $1).
... (9 Replies)
Discussion started by: usustarr
9 Replies
7. Shell Programming and Scripting
hi,
I want to compare i variable in the awk statement but its not working out. Pl help me out
If we do the comparison like this its OK,
cat sample | awk -F" ", '{if ($1=="1-Sep-2009") print $1,$2,$3,$4,$5}'
But if u use a variable instead of "1-Sept-2009", it does not return anything,... (2 Replies)
Discussion started by: asadlone
2 Replies
8. UNIX for Dummies Questions & Answers
I have an input file. Each line in it has several characters. If the first three characters of the line is '000' or '001' or '002' or '003', I need to print it in output. How can I do this in awk.
I am able to do if the search string is only one (let us say 000).
cat <filename> | awk... (1 Reply)
Discussion started by: paruthiveeran
1 Replies
9. Shell Programming and Scripting
:)
Suppose,I have one table A. Table A have one column. Table A have 10 rows. I want this 10 rows store into shell script variable.
like
#!/bin/ksh
v_shell_var=Hi
here in call oracle , through loop How can I store table A's 10 rows into v_shell_var (Shell Script Array).
Regards,
Div (4 Replies)
Discussion started by: div_Neev
4 Replies
10. Shell Programming and Scripting
Hi,
I made a small awk program just to test array variables.
I couldn't find anything wrong with it.
But it doesn't give out valid numbers.( just 0.00 )
Do you see any problem that I didn't see?
Thanks in advance!
Here is the program:
##################################
BEGIN {
FS =... (4 Replies)
Discussion started by: whatisthis
4 Replies