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
Hai,
I want to select only line numbers into a file if some pattern matches. I have written my script like below but its not working.
#!/bin/sh
file='/home/testfile1'
filesearch='/home/test00'
while read line
do
search=`echo $line |cut -c 1-24`
echo $search
echo `grep -n ""... (3 Replies)
Discussion started by: Subbu123
3 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. UNIX for Dummies Questions & Answers
I am trying to extract specific information from a large *.sam file (it's originally 28Gb).
I want to extract all lines that are on chr3 somewhere in the range of 112,937,439-113,437,438.
Here is a sample line from my file so you can get a feel for what each line looks like:
seq.4 0 ... (8 Replies)
Discussion started by: genGirl23
8 Replies
5. Shell Programming and Scripting
Hi! I'm trying to assign line numbers to each line of the file
for example consider the following..
The contents of the input file are
hello how are you?
I'm fine.
How about you?
I'm trying to get the following output..
1 hello how are you?
2 I'm fine.
3 How about you? ... (8 Replies)
Discussion started by: abk07
8 Replies
6. 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
7. UNIX Desktop Questions & Answers
Hi all,
I am new to unix and struggling to do the below
I have few lines in a xml
<title>abc:1</title>
<description>abc:2</description>
<language>abc:3</language>
Is it possible to extract only the entire word like abc:1 abc:2 abc:3 instead of the entire line into a new file . Kindly... (3 Replies)
Discussion started by: umapearl
3 Replies
8. UNIX for Dummies Questions & Answers
Hello,
I'm trying to grep for digits surrounded by non digits and I'm obviously misinformed. Could someone help me get this sorted out
here is what I have that is not working
grep -ho '\D(\{11\})\D' *.txt (5 Replies)
Discussion started by: mcgrailm
5 Replies
9. UNIX for Advanced & Expert Users
Hi i would like to add line numbers to end of each line in a file.
I am able to do it in the front of each line using sed, but not able to add at the end of the file.
Can anyone suggest
The following code adds line number to start of each line
sed = filename | sed 'N;s/\n/\t/'
how can i... (5 Replies)
Discussion started by: rudoraj
5 Replies
10. Shell Programming and Scripting
Hi,
I want to find out whether a string contains non numbers and + and -
example :
Str="0005000A" - It contains A
Str="0005000+" - No problem
What I have done is ,
echo $Str | grep
I will have to list out all non numeric characters... (6 Replies)
Discussion started by: shihabvk
6 Replies