Search Results

Search: Posts Made By: manishma71
28,696
Posted By manishma71
grep any number of spaces
which one of the following is the correct expression to ignore line with multiple spaces after any string

cat file | grep -v "xyz *$"
or
cat file | grep -v "xyz[ ]*$"


do i need "[ ]*" to...
1,880
Posted By manishma71
use of "comm" command solved the...
use of "comm" command solved the problem..
1,602
Posted By manishma71
Below case does not work T=b; echo...
Below case does not work


T=b; echo "a,0.1,0,0,b,0" | awk -F"$T" -v T=$T '{gsub(/0/,"1",$1); print $1 T $2}'


output should be

a,0.1,1,1,b,0

but it is

a,1.1,1,1,b,0
1,602
Posted By manishma71
problems with sed
$ echo "a,0,0,0,b,0" | sed 's/,0,/,1,/g'

gives output as

$ a,1,0,1,b,0


rather than as

a,1,1,1,b,0


how can i solve this problem

Thanks a lot in advance....

Use code tags.
1,880
Posted By manishma71
Solved: finding diff in files
i want to compare 2 files and generate below 3 files:
1. new lines
2. updated lines
3. deleted lines

are there any one liners for each one of them.

Note the method to find duplicates is...
32,032
Posted By manishma71
THRESHOLD="1.25" ratio=$( echo "scale=2;...
THRESHOLD="1.25"
ratio=$( echo "scale=2; ${prev}/${current}" | bc )

if [ $(echo "${ratio} > ${THRESHOLD}" | bc ) -eq 1 ]; then
split_date=`echo ${line} | cut -d, -f2`
fi

got the...
32,032
Posted By manishma71
$ echo '1 < 2' | bc 1 $echo '1 > 2' | bc ...
$ echo '1 < 2' | bc
1
$echo '1 > 2' | bc
0
32,032
Posted By manishma71
whats wrong with this line: if [ $(echo...
whats wrong with this line:
if [ $(echo "${ratio} > ${THRESHOLD}" | bc ) -eq 1 ]; then

why is it giving error:
(standard_in) 2: parse error
(standard_in) 1: parse error

---------- Post...
32,032
Posted By manishma71
pravin and agn - looks like what you guys said is...
pravin and agn - looks like what you guys said is not helping

#################### CODE ####################
#!/bin/sh

a="1.23"
b="2.45"

if [ $a > $b ]; then
echo "string compare:...
32,032
Posted By manishma71
bc giving error: (standard_in) 2: parse error
Below part of script, is working fine sometimes and gives error sometime.
I am doing float operations, checking if x > y.

##########CODE##########
THRESHOLD="1.25"
ratio=$( echo "scale=2;...
2,566
Posted By manishma71
perl command in shell not working
perl script i am using for search and replace is not working as expected...
I am using it for in-place search/replace.

I am new to perl, can someone please help me solving the issue here.
...
1,880
Posted By manishma71
change field 2 date format
from this input

WEBELSOLAR,29122009,1:1
WIPRO,15062010,2:3
ZANDUREALT,18012007,1:3

i want output as
WEBELSOLAR,20091229,1:1
WIPRO,20100615,2:3
ZANDUREALT,20070118,1:3

basically input...
5,647
Posted By manishma71
thanks a lot radoulov... this is really of great...
thanks a lot radoulov... this is really of great help :)
5,647
Posted By manishma71
thanks a lot radoulov ---------- Post...
thanks a lot radoulov

---------- Post updated at 02:09 PM ---------- Previous update was at 02:07 PM ----------

can above formula perform sorting for multiple columns also.
in case yes, can...
5,647
Posted By manishma71
I want a command which will sort on the basis of...
I want a command which will sort on the basis of value between . and :

The solution provided might have issues if there are more dots in the input line after the : which makes this solution prone...
5,647
Posted By manishma71
05.50.25:BMWG.DE:RESTRICTED:N: ...
05.50.25:BMWG.DE:RESTRICTED:N:
05.50.25:BASF.MI:RESTRICTED:N:
05.50.25:AIRE.S:RESTRICTED:S2:
05.50.25:BORE.ST:RESTRICTED:N:
05.50.25:ANDR.VI:RESTRICTED:S2:

this is how it should look like
5,647
Posted By manishma71
Sort on basis of particular field
05.50.25:AIRE.S:RESTRICTED:S2:
05.50.25:ANDR.VI:RESTRICTED:S2:
05.50.25:BASF.MI:RESTRICTED:N:
05.50.25:BMWG.DE:RESTRICTED:N:
05.50.25:BORE.ST:RESTRICTED:N:

I can sort of the basis of second...
2,190
Posted By manishma71
sort group of n lines base on pattern in first line
I have record having 10 fields and each field being printed on a new line, first line cotains name of exchange, 2nd line stock name, third line stock price, etc etc...

now i want to retrieve data...
Showing results 1 to 18 of 18

 
All times are GMT -4. The time now is 10:39 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy