Last 10? or start from? Proper grammar would help here.
Remove last ten characters on all lines from the third through the end:
Coping with lines with fewer than ten characters left as a desperate follow-up question with incomplete sentences and weird terminology. You're welcome.
Aloha! I have just over 1k of users that have permissions that they shouldn't under our system. I need to parse a provided list of usernames, check their permissions file, and strip the permissions that they are not allowed to have. If upon the permissions strip they are left with no permissions,... (6 Replies)
what is the sed command to remove the first two characters of every line of a text file?
each line of the text file has the same amount of characters, and they are ALL NUMERIC. there are hundreds of lines though.
for example,
>cat file1.txt
10081551
10081599
10082234
10082259
20081134... (20 Replies)
Hello,
I have multiple lines in a file, each of which will have data that looks like this:
xxxxxyyyyzzzz4abcdXYZXYZXYZ
pqrstPQRST2cdPQRSTPQRST
lmnopqr6abcdefgRST.3abc
I want to be able to remove the number 4 + the following 4 characters (abcd) in the first line.
For the second line,... (1 Reply)
Hello,
Is there a simpler way to remove special characters (color codes) from each lines in a log file?
I use sed like in the example below but I think there should be a more simple way to achieve the same result:
$ cat -vet file1
^, , , ,
Maybe to convert the file somehow?
... (5 Replies)
Hello everyone,
This is my first posting. I have read the rules of this forum. I have searched many various threads and haven't found one that applies to my situation or suggestions to fix the issue. I do appreciate the help.
I am trying to execute a basic UNIX script in a Solaris... (4 Replies)
I tried using below command
tr -cd "" < InputFile.xml > output.txt ============= This removes all the tabs/newline/extra spaces from a file
it successfully removed all the extra spaces,tabs and new line characters but then the complete file become one record. I want to retain one new line... (1 Reply)
Hi,
I have a file with lines like below.
I need to remove first few characters from each line until a date format is found.
05/06/12 20:47:02 GUMGUY@98.192.174.74{42B42A72AC955F5926621273E3A15059.tomcat2}TP-Processor15 LogExchUsage: ERROR:
05/06/12 20:47:02... (8 Replies)
I have a the following line
22.152.25.36 - K##### "GET /DGGKE/GetMail.do;jwebsphere=FADFFFGSFGSFGSDGFSDFGSDFGSDF HTTP/1.1" 200 44948
Need a cut command which should give me the below output
22.152.25.36 - K##### "GET /DGGKE/GetMail.do HTTP/1.1" 200 44948
Note: The value of jwebsphere can... (6 Replies)
I have a test file with the following format, It contains the username_date when the user was locked from the database.
$ cat lockedusers.txt
TEST1_21062016
TEST2_02122015
TEST3_01032016
TEST4_01042016
I'm writing a ksh script and faced with this difficult scenario for my... (11 Replies)
Hello,
I am java command from a shell script which will generate the below output on the command prompt
signature Base64 :... (10 Replies)
Discussion started by: chetanojha
10 Replies
LEARN ABOUT ULTRIX
nl
nl(1) General Commands Manual nl(1)Name
nl - line numbering filter
Syntax
nl [-h type] [-b type] [-f type] [-v start#] [-i incr] [-p ] [-l num] [-s sep] [-w width] [-n format] [-d delim] file
Description
The command reads lines from the named file or from the standard input, if no file is named, and reproduces the lines on the standard out-
put. Lines are numbered on the left in accordance with the command options in effect.
The command views the text it reads in terms of logical pages. Line numbering is reset at the start of each logical page. A logical page
consists of a header, a body, and a footer section. Empty sections are valid. Different line numbering options are independently avail-
able for header, body, and footer. For example, you can elect not to number header and footer lines while numbering blank lines in the
body.
The start of logical page sections is signaled by input lines containing nothing but the following delimiter characters:
Line contents Start of
::: header
:: body
: footer
Unless otherwise specified, assumes that the text it is reading is in the body of a single logical page.
Options
Command options may appear in any order and may be intermingled with an optional file name. Only one file may be named.
-b type Specifies which logical page body lines are to be numbered. The following are recognized types and their meaning: a,
number all lines; t, number lines with printable text only; n, no line numbering; pstring, number only lines that con-
tain the regular expression specified in string.
The default type for logical page body is t (text lines numbered).
-h type Same as -b type except for header. Default type for logical page header is n (no lines numbered).
-f type Same as -b type except for footer. Default for logical page footer is n (no lines numbered).
-p Do not restart numbering at logical page delimiters.
-v start# The initial value used to number logical page lines. Default is 1.
-i incr The increment value used to number logical page lines. Default is 1.
-s sep The character used in separating the line number and the corresponding text line. Default sep is a tab.
-w width The number of characters used for the line number. Default width is 6.
-n format The line numbering format. Recognized values are the following: ln, left justified, leading zeroes suppressed; rn,
right justified, leading zeroes suppressed; rz, right justified, leading zeroes kept. Default format is rn (right jus-
tified).
-l num The number of blank lines to be considered as one. For example, -l2 results in only the second adjacent blank being
numbered (if the appropriate -ha, -ba, or -fa option is set). Default is 1.
-d xx The delimiter characters specifying the start of a logical page section may be changed from the default characters (:)
to two user-specified characters. If only one character is entered, the second character remains the default character
(:). No space should appear between the -d and the delimiter characters. To enter a backslash, you must type two
backslashes (//).
Examples
nl -v10 -i10 -d!+ file1
This command numbers file1 starting at line number 10 with an increment of ten. The logical page delimiters are !+.
See Alsopr(1)nl(1)