10 More Discussions You Might Find Interesting
1. UNIX for Beginners Questions & Answers
Hi All,
I am trying to replace a certain value from one place in a file . In the below file at position 35 I will have 8 I need to modify all 8 in that position to 7
I tried
awk '{gsub("8","7",$35)}1' infile > outfile ----> not working
sed -i 's/8/7'g' infile --- it is replacing all... (3 Replies)
Discussion started by: arunkumar_mca
3 Replies
2. UNIX for Dummies Questions & Answers
Can anyone help me in this?
Here is the Secenario.
I need to count the Numerical vaues from the below output
Item processed: 1401
Item processed: 2839
Item processed: 1261
Item processed: 2584
Item processed: 2
Item processed: 988
Item processed: 1
Item processed: 2119
... (3 Replies)
Discussion started by: Padmanabhan
3 Replies
3. Shell Programming and Scripting
I have a code like this
v_num=9
comp_num=39
if
then
echo "pass"
fi
echo "end"
I am getting an error
ksh: v_num=99
comp_num=39
if
then
echo "pass"
fi
echo "end" (3 Replies)
Discussion started by: swayam123
3 Replies
4. UNIX for Dummies Questions & Answers
Hey guys & gals,
I am hoping for some advice on a sed or awk command that will
allow to only print lines from a file that contain 3 numeric values.
From previous searches here I saw that ygemici used the sed command
to remove lines containing more than 3 numeric values ;
however how... (3 Replies)
Discussion started by: TAPE
3 Replies
5. Shell Programming and Scripting
Dear all,
I have numerous dat files (1.dat, 2.dat...) containing 500 numeric values each. I would like to count them, based on their range and obtain a histogram or a counter.
INPUT:
1.dat
1.3
2.16
0.34
......
2.dat
1.54
0.94
3.13
.....
... (3 Replies)
Discussion started by: chen.xiao.po
3 Replies
6. Shell Programming and Scripting
Hi all.
This is one of my interview question.
input : apple
output :
a - 1
p - 2
l - 1
e - 1
i written the code like this
echo "apple" | fold -w1 | sort | uniq -c | awk '{print $2 "-->" $1}'
is any other way to do ? (5 Replies)
Discussion started by: itkamaraj
5 Replies
7. Shell Programming and Scripting
How to check if the file contains only numeric values.
I don't want to read entire file it eats lot of cpu
Or any way which consumes less memory n cpu..
Please suggest
-S (2 Replies)
Discussion started by: sunilmenhdiratt
2 Replies
8. Programming
I am getting back on the C++ programming after many years away. I recently received an SDK that has code like this where numeric values end in 'U'. What does this mean?
if ((ptr % 16U) == 0U)
return buffer; (3 Replies)
Discussion started by: sneakyimp
3 Replies
9. Shell Programming and Scripting
Hello all,
I am working on a basic script but need a little help.
Issue:
I am running a SQL Query using sqlplus and a shell script. I have the output of the statement stored as variable $A. $A is set to "other text here 45678754 other text here". I need to strip all text except that numeric... (13 Replies)
Discussion started by: ownedthawte
13 Replies
10. Shell Programming and Scripting
What could be the regular expression with gsub function in awk to replace all numerics having spaces before to be replaced with 0s? (1 Reply)
Discussion started by: videsh77
1 Replies