Search Results

Search: Posts Made By: boaz733
1,175
Posted By mjf
boaz733, See this link on several different...
boaz733,
See this link on several different solutions for printing lines between 2 strings:
...
1,316
Posted By RudiC
Try sed -n '/noob/{:L;N; /noob.*noob/bK; bL;...
Try sed -n '/noob/{:L;N; /noob.*noob/bK; bL; :K;p;q}' file
noob
please
im a noob


---------- Post updated at 15:04 ---------- Previous update was at 14:58 ----------

awk:awk '/noob/ {print;...
1,316
Posted By RavinderSingh13
Hello boaz733, Could you please try...
Hello boaz733,

Could you please try following and let me know if this helps you.

awk '/noob/{A++;if(A==1 || A==2){print};next};{if(A==1){print}}' Input_file
Output will be as follows.
...
17,016
Posted By Scrutinizer
Try: sed '/Sheep/,/you/s/you/us/' file
Try:
sed '/Sheep/,/you/s/you/us/' file
17,016
Posted By bartus11
Try:perl -0pe 's/(?<=Sheep)(.*?)you/$1us/s'...
Try:perl -0pe 's/(?<=Sheep)(.*?)you/$1us/s' file
1,873
Posted By CarloM
Have you tried /usr/xpg4/bin/grep?
Have you tried /usr/xpg4/bin/grep?
1,873
Posted By zaxxon
If the digit is always in the last field, you can...
If the digit is always in the last field, you can try:

$ awk 'NR==FNR {_[$1]=$1; next} _[$NF] {print l} {l=$0}' f1 f2
dave the killer
heads night


If it could be anywhere in the line, try:
...
7,798
Posted By birei
Hi boaz733, One way using 'perl': $...
Hi boaz733,

One way using 'perl':

$ perl -ne 'if ( /2012\/01\/02 12:00:07/ .. /2012\/01\/03 12:00:08/ ) { print }' infile
result.log.00:2012/01/02 12:00:07.422 LOG STARTED HERE
...
5,606
Posted By itkamaraj
man seq see the -w option ----------...
man seq

see the -w option

---------- Post updated at 03:19 PM ---------- Previous update was at 03:14 PM ----------

i guess it should be


seq -w 001 500
5,606
Posted By jayan_jay
$ i=1; while [ $i -le 500 ]; do printf "%03d\n"...
$ i=1; while [ $i -le 500 ]; do printf "%03d\n" $i ; i=$((i+1)); done
1,494
Posted By jayan_jay
$ sed -n '/stop:/,$p' infile $ nawk...
$ sed -n '/stop:/,$p' infile


$ nawk '/stop:/,0' infile
1,494
Posted By Corona688
grep doesn't have "if-then" logic. it can't do...
grep doesn't have "if-then" logic. it can't do different things to following lines, depending on previous lines. It just matches lines individually.

It can quit on the first match, but that...
1,897
Posted By binlib
I always disable bash history expansion with "set...
I always disable bash history expansion with "set -H", or you can escape the "!" with "\".
perl -pe's/(?<=\)\)\)\),)(\d+)/($1-5)/e' infileAdd "-i" to the perl options if you want in place editing.
2,156
Posted By agama
Test for it and if it's there branch round the...
Test for it and if it's there branch round the replacement:


sed '/#$/b; s/$/#/' input-file
2,156
Posted By binlib
sed '/#$/!s/$/#/' filename
sed '/#$/!s/$/#/' filename
1,897
Posted By jayan_jay
Go with this .. $ nawk...
Go with this ..

$ nawk 'BEGIN{FS=",";OFS=","}!/,$/{$NF=$NF-5")";print}/,$/{$(NF-1)=$(NF-1)-5")"; print}' infile
3,044
Posted By balajesuri
The Perl way. perl -pe...
The Perl way.
perl -pe 'BEGIN{$i=1}s/^/$i=>/;$i++' inputfile.txt
3,044
Posted By BeefStu
Unix provided a nice utilty called nl (number...
Unix provided a nice utilty called nl (number line) see if that could help
you. If not see if this works for you



cat xx.data

red
hello world
green
blue ribbon winner


cat...
3,044
Posted By jim mcnamara
See if your version of nl supports the -s option:...
See if your version of nl supports the -s option:

nl -s '=>' myfile > mynewfile


IT should have that option, because -s is part of the POSIX standard.
1,897
Posted By jayan_jay
$ nawk 'BEGIN{FS="," ; OFS=","}...
$ nawk 'BEGIN{FS="," ; OFS=","} {$(NF-1)=$(NF-1)-5")"; print}' infile
2,072
Posted By m.d.ludwig
0936 - 09C1 is egrep...
0936 - 09C1 is

egrep '09(3[6-9A-F]|[4-9AB][0-9A-F]|C[01])$'

(assuming hexidecimal data)
24,955
Posted By rocker_me2002
echo "Please select the file from the list" ...
echo "Please select the file from the list"

files=$(ls *.txt)
i=1

for j in $files
do
echo "$i.$j"
file[i]=$j
i=$(( i + 1 ))
done

echo "Enter number"
read input
echo "You select the...
1,239
Posted By vgersh99
echo 'zonecreate " ( uses the file name...
echo 'zonecreate " ( uses the file name "LOCAL_HOST") ","'$(xargs <myWWNfile.txt | sed 's/ /;&/g' ) '"'
1,593
Posted By radoulov
I get a different result, could you check if your...
I get a different result, could you check if your example output is correct with respect to the posted content?

awk 'END {
if (f)
print f
}
NR == FNR {
f1[$1]
next
}...
1,975
Posted By radoulov
Sure: perl -ne' s/pwwn =...
Sure:

perl -ne'
s/pwwn = 0x(\S+).*/($x=$1)=~s|..(?!\z)|$&:|g;$x/e
and print
' infile
Showing results 1 to 25 of 27

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