Search Results

Search: Posts Made By: masterpiece
1,392
Posted By k_manimuthu
perl -ne '/(\d+)/; if ( $1 >= 6 && $1 <= 10...
perl -ne '/(\d+)/; if ( $1 >= 6 && $1 <= 10 ){print}' temp.txt
perl -ne '/(\d+)/; if ( $1 >= 11 && $1 <= 100 ){print}' temp.txt
perl -ne '/(\d+)/; if ( $1 >= 101 ){print}' temp.txt
1,392
Posted By itkamaraj
$ nawk '{ if($2<10){print $0 >...
$ nawk '{ if($2<10){print $0 > "1.txt"}else{if($2<100){print $0 >"2.txt"}else{print $0 > "3.txt"}}}' test


$ cat 1.txt
UDUYDS 8
UIUHKK 6


$ cat 2.txt
KJKAJK 89...
1,392
Posted By zaxxon
It might be easier using something like this for...
It might be easier using something like this for group 2 for example:

$> awk '$2 >= 11 && $2 <= 100' infile
KJAJAK 100
KJKAJK 89
JOIJOI 21
JDKDJL 12
1,392
Posted By bartus11
awk '$2>=6&&$2<=10' file awk '$2>=11&&$2<=100'...
awk '$2>=6&&$2<=10' file
awk '$2>=11&&$2<=100' file
awk '$2>=101' file
1,445
Posted By yazu
Assuming your numbers are in the file...
Assuming your numbers are in the file "line.numbers" like so
3
4
7
perl -lne ' ...
55,888
Posted By anbu23
Check whether you have any control m characters...
Check whether you have any control m characters in your script

cat -vet sql.sh
36,102
Posted By m.d.ludwig
From grep:Anchoring The caret ^ and the dollar...
From grep:Anchoring
The caret ^ and the dollar sign $ are meta-characters that respectively match the empty string at the beginning and end of a line.
So you need to use:
grep -w ^531250 file
36,102
Posted By Franklin52
grep '^531250' file
grep '^531250' file
36,102
Posted By Chubler_XL
From the grep manual: The test is that the...
From the grep manual:
The test is that the matching substring must either be at the beginning of the line, or preceded by a non-word constituent character.
Similarly, it must be either at the end...
7,864
Posted By
while read line1 do line2=`grep "$line1"...
while read line1
do
line2=`grep "$line1" file2`
if [ ! -z "$line2" ] ; then
echo "$line2" >> file3
else
echo "" >> file3
fi
done < file1
Showing results 1 to 10 of 10

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