10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hello to all,
How would be the correct regex to match only the first occurence of
the pattern 3.*6.
I'm trying with 3.*6 trying to match only 34rrte56, but with my current regex is matching 4rrte567890123456789123powiluur56. And if I try with ?
doesn't print anything
echo... (6 Replies)
Discussion started by: Ophiuchus
2. Shell Programming and Scripting
I have a file
# cat asasas
NILNILNIL (2 Replies)
Discussion started by: anil510
3. Shell Programming and Scripting
I have data like below and i need to add coloumn before the COUNT field to see the Percentage out of all COUNT field value for respective raw.
COUNT CODE sConnType tConnType... (6 Replies)
Discussion started by: Iroshan
4. Shell Programming and Scripting
I have a text file:
Currently I have
first=`grep firstname file.txt | head -1`
age=`grep -A 2 $name file.txt | tail -1` (7 Replies)
Discussion started by: etranman1
5. UNIX for Dummies Questions & Answers
I need to count the occurence of a certain pattern.
For example the pattern is PC.
the contents of the file sample.txt:
asdfa PC sadfaf
if i use grep -c PC sample.txt
it will display 3 as the number of occurence
how do i save that number to a... (1 Reply)
Discussion started by: khestoi
6. UNIX for Dummies Questions & Answers
Above is the content of File1.txt, i want to get the Number of Occurence to order, lets say if OMC LA = 1, OMC LS=3, and OMC LK=2..
omc_ident="OMC LA" or "OMC LK" or "OMC LS"
omc_num=`grep '^OMC' File1.txt| grep... (4 Replies)
Discussion started by: neruppu
7. UNIX for Dummies Questions & Answers
supoose i have a file in which a word is repeated so many times.
I just want the firts occurence of that word through grep and it should not go to the next one means get the first occurence and stop there.
Suggest me some solutions.
Namish (10 Replies)
Discussion started by: namishtiwari
8. Shell Programming and Scripting
Is there any awk or unix command that i can make use such that the output will be as desired ?
The code will extract the latest pattern starting from the term above the asterix till the end of the input
aaa bbb 2007
xxx yyy 2007... (9 Replies)
Discussion started by: Raynon
9. UNIX for Advanced & Expert Users
This is the format of the file that i have
EndDate :10/02/06 (5 Replies)
Discussion started by: kkm_job
10. UNIX for Dummies Questions & Answers
I am using grep to pull out info from a file.
The line I am searching for begins:
START TIME - Tue Sep 11 16:40:00.
There are mutiple lines of START TIME. I need the FIRST occurence ONLY.
My grep is as follows:
start="$( grep 'START TIME' filename | cut -c15-33)"
If I echo or cat... (2 Replies)
Discussion started by: app4dxh