Search Results

Search: Posts Made By: mstafreshi
2,699
Posted By mstafreshi
sed '/InventoryVisibility/,/<\/active>/...
sed '/InventoryVisibility/,/<\/active>/ s/true/False/' filename
2,013
Posted By mstafreshi
awk '$1 != last && NR != 1 { print "ok\n"; } $1...
awk '$1 != last && NR != 1 { print "ok\n"; } $1 != last { print "category " $1; last = $1;}{print "item " $2}END{print "ok"}' filename
1,045
Posted By mstafreshi
y=`sort -k3,3nr filename | awk 'NR == 1 { print...
y=`sort -k3,3nr filename | awk 'NR == 1 { print $3}'`
awk '{$3 = $3 / '$y';printf("%s\t%d\t%0.2f\n", $1, $2, $3);}' filename
output :

chr2L 552 0.22
chr2R 135 0.27
chr3L 820 ...
1,446
Posted By mstafreshi
awk ' $2 > max { max = $2 } NR == 1 { next;...
awk '
$2 > max { max = $2 }
NR == 1 { next; }
$1 == 1 { print 1, max; max = $2; }
' filename
my code return one row less than your output! can it help you find your way ?
2,181
Posted By mstafreshi
awk '{print "|" $0}' logfile | sort | uniq -c |...
awk '{print "|" $0}' logfile | sort | uniq -c | awk -F"|" '{printf("%40s:\t%5s\n", $2, $1)}'
2,863
Posted By mstafreshi
your file has at least 12 lines ?
your file has at least 12 lines ?
2,863
Posted By mstafreshi
sed '12i\ asdasdasdasdsad' test.cpp >...
sed '12i\
asdasdasdasdsad' test.cpp > output.txt
you must add a new line after your backslash .
15,299
Posted By mstafreshi
sed 's/|[a-zA-Z0-9]*|[a-zA-Z0-9]*//' filename
sed 's/|[a-zA-Z0-9]*|[a-zA-Z0-9]*//' filename
2,914
Posted By mstafreshi
sed 's/,/ /g' logfile
sed 's/,/ /g' logfile
1,733
Posted By mstafreshi
sort -t"|" -k1nr -k4nr filename | awk -F"|" '$1...
sort -t"|" -k1nr -k4nr filename | awk -F"|" '$1 != index1 { print; index1=$1}'
And this is oputput

-10.5|6|L|56|MR||R||012009|E
-10.75|6|L|18|||U||012008|E
-11|6|L|17|||R||012008|E...
1,733
Posted By mstafreshi
sort -t"|" -k1nr -k4nr filename | awk -F"|" '$1...
sort -t"|" -k1nr -k4nr filename | awk -F"|" '$1 != index1 { print; index1=$1}'
1,597
Posted By mstafreshi
Hello I don't know your bussiness and i has not...
Hello
I don't know your bussiness and i has not work with excell !
I just test this script with one line of example you provided . can this scripts works as expected?


case $# in
1)...
1,260
Posted By mstafreshi
a great book : Unix programming environment by...
a great book : Unix programming environment by kernighan and rob pike
1,874
Posted By mstafreshi
sed 's/.*<m:string>// ...
sed 's/.*<m:string>//
s/<\/m:string>.*//' filename
14,480
Posted By mstafreshi
this is a simple script . can it help find your...
this is a simple script . can it help find your way ?

os=ofs #old size
logFile=logFile

# test log file exists !
test -r $logFile || { echo "can't open $logFile"; 1>&2; exit 1; }

# get...
2,148
Posted By mstafreshi
replace for i in...
replace
for i in /users/jack/system1-dr.txtwith
for i in `cat /users/jack/system1-dr.txt`the code between ` ` will be executed and become arguments for "for loop"
1,597
Posted By mstafreshi
Hello with examples and numbers you provide i...
Hello
with examples and numbers you provide i wrote this code .
my shell is bourne . save the code in a file called diya123 and chmod it to 755 :

chmod 755 diya123
save your data in a file...
Showing results 1 to 17 of 17

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