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.
---------- Post updated at 05:58 PM ---------- Previous update was at 05:41 PM ----------
OK, I got it, this works
will match a digit followed by any two characters at the end of a line. If what you want is three digits at the end of a line, try:
or
Hi,
I am having problems using grep to extract only 3,4 or 5 digit numbers from a text file, using:
grep '\<\{3,5\}\>' test.txt
or
grep '\{3,5\}' test.txt
or
egrep '{3,5}' test.txt
I would appreciate any help that anyone can give me
thanks (1 Reply)
Hello All,
Currently I am attempting to write a script which will capture a number at the end of a line.
The line which I am searching through ends as follows:
word word=number
for example
word word=3
OR
word word=15
I am stuck on how to capture whatever is to the right... (3 Replies)
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)
I have a file with hundreds of records and I need to find those records that have three digits at the beginning and the same three digits at the end.
$GREP '\(\)\(\)\(\)\3\2\1'I
believe this is part of the script but I am not sure how to compare these 3 digits with the 3 digits at the end of... (2 Replies)
Hi All,
I have a file which has some Linux commands in every line like
more 456.dat
more 3232.dat
more 433.dat
I want to add texts like this at the end of every line:
more 456.dat > 1.txt
more 3232.dat > 2.txt
more 433.dat > 3.txt
So, that the result of more goes into 1.txt... (1 Reply)
I have datafile like
~dta.yunm
shhshsgggssssjsksjs
sggsjshsjsjssss
shshshhshshshs
i wish to take only first line and all other lines in concatenated form in second line what should I do???
output like
~dta.yunm
shhshsgggssssjsksjssggsjshsjsjssssshshshhshshshs
please tell me how... (7 Replies)
I want to parse the lines and want to extract the double quoted numbers as:
"SQL3149N "72" rows were processed from the input file. "0" rows were
successfully inserted into the table. "0" rows were rejected."
and want the output in 3 variables like
a=72
b=0
c=0
thanks in advance
... (3 Replies)
I need help to extract the file. If I am entering the user name like abcd@xyz.com, search the username and get the tread number. Once will get thread number all the line having same threadnumber wanted to keep in seperate file. It can be more than thread number for single username.
For... (3 Replies)
Hello,
I haven't been here for a while and I might be forgetting some things.
I have an input text like this
titleA
http://myurl/bla/blabla/1234
http://myurl/bla/blabla/6789
titleB
http://myurl/bla/blabla/5678
http://myurl/bla/blabla/1234
titleC
http://myurl/bla/blabla/9123... (10 Replies)
Discussion started by: Kibou
10 Replies
LEARN ABOUT DEBIAN
plan9-look
LOOK(1) General Commands Manual LOOK(1)NAME
look - find lines in a sorted list
SYNOPSIS
look [ -dfnixtc ] [ string ] [ file ]
DESCRIPTION
Look consults a sorted file and prints all lines that begin with string. It uses binary search.
The following options are recognized. Options dfnt affect comparisons as in sort(1).
-i Interactive. There is no string argument; instead look takes lines from the standard input as strings to be looked up.
-x Exact. Print only lines of the file whose key matches string exactly.
-d `Directory' order: only letters, digits, tabs and blanks participate in comparisons.
-f Fold. Upper case letters compare equal to lower case.
-n Numeric comparison with initial string of digits, optional minus sign, and optional decimal point.
-t[c] Character c terminates the sort key in the file. By default, tab terminates the key. If c is missing the entire line comprises the
key.
If no file is specified, /lib/words is assumed, with collating sequence df.
FILES
/lib/words
SOURCE
/src/cmd/look.c
SEE ALSO sort(1), grep(1)DIAGNOSTICS
The exit status is ``not found'' if no match is found, and ``no dictionary'' if file or the default dictionary cannot be opened.
LOOK(1)