10 More Discussions You Might Find Interesting
1. UNIX for Advanced & Expert Users
How would you grep for a line containing only 5 numbers? Something like this.
10 2 12 1 13 (4 Replies)
Discussion started by: cokedude
4 Replies
2. Shell Programming and Scripting
I have a text file with a line of text that contains numbers and text formatted into groups. I need to extract the number that can be either 1,2 or 3 digits long. Then write it to a variable, but i need to remove any leading spaces in the number first.
I can get the numbers out but how to remove... (12 Replies)
Discussion started by: kcpoole
12 Replies
3. UNIX for Dummies Questions & Answers
I'm trying to grep lines where the digits at the end of each line are greater than digits. Tried this but it will only allow me to specify 2 digits. Any ideas would greatly be appreciated. grep -i '\<\{3,4,5\}\>' file
---------- Post updated at 05:58 PM ---------- Previous update was at 05:41... (1 Reply)
Discussion started by: jimmyf
1 Replies
4. Shell Programming and Scripting
I am looking at using grep to locate the line in the text file and them use awk to select a word or words out of it.
I know awk needs -v to allow a variable to be used, but also needs -F to allow the break up of the sentence and allow the location of separate variables.
$line = grep "1:" File |... (8 Replies)
Discussion started by: Ironguru
8 Replies
5. Shell Programming and Scripting
I want to select contents between two numbers say 1. and 2. from an output file which has many numbers but only the these two ending with a dot(.) eg 1. 2 . 32. etc I was looking to select with the use of a counter then modify the selected contents and put it in an output file where again the... (3 Replies)
Discussion started by: ausfragen
3 Replies
6. UNIX for Dummies Questions & Answers
I know if i use grep -n that the output will have the lines numbered but is there a way to grep the actually line number.
so like this
grep -n "one" /usr/dict/numbers
1:one
21:twenty-one
31:thirty-one
41:forty-one
51:fifty-one
61:sixty-one
71:seventy-one
81:eighty-one
91:ninety-one
... (1 Reply)
Discussion started by: alindner
1 Replies
7. UNIX for Advanced & Expert Users
I m trying to grep 'select * from' from a script, but the problem is with the * ...
I think its taking * as some special character ...
when I try to do grep '*' test (test is my test file) its displaying *
But when I am trying to do grep 'select * from' test its not showing anything... (2 Replies)
Discussion started by: RDR
2 Replies
8. Shell Programming and Scripting
I have a txt file with more than 10000 lines. There is a unique pattern which is scattered into the file. it starts with @9 and it has 15 characters. i need to grep them and display along with line numbers.
Eg: File - Test1
test message....
....
..
..
@9qwerty89
...test message... (8 Replies)
Discussion started by: abinash
8 Replies
9. UNIX for Advanced & Expert Users
Hi Guru's,
Before writing to this forum I have searched extensively on this forum about my problem.
I have to write a shell script which takes out only those file names from the given directory which contains only numbers. For example, In the given directory these files are present:
... (4 Replies)
Discussion started by: spranm
4 Replies
10. UNIX for Dummies Questions & Answers
Hi Guru's,
Before writing to this forum I have searched extensively on this forum about my problem.
I have to write a shell script which takes out only those file names from the given directory which contains only numbers. For example, In the given directory these files are present:
... (0 Replies)
Discussion started by: spranm
0 Replies