Neither of those example lines have a display width of over 79 characters. Anyway, again: a tab is a single character and the script counts characters. If you want to work on the display width, you will need to expand tabs one way or another.
Did you try the expand command as suggested above?
write a shell script that accepts a file name starting and ending line numbers as arguments and displays all the lines between the given line numbers:b:.help is appreciated.thank you. (3 Replies)
I know this should be simple, but I've been manning sed awk grep and find and am stupidly stumped :(
I'm trying to use sed (or awk, find, etc) to find 4 characters on the second line of a file.txt 44-47 characters in. I can find lots of sed things for lines, but not characters. (4 Replies)
Hi,
I would like to know how to solve one of my problems using expert unix commands.
I have a file with occasional blank lines;
for example;
dertu
frthu
fghtu
frtty
frtgy
frgtui
frgtu
ghrye
frhutp
frjuf
I need to edit the file so that the file looks like this; (10 Replies)
Hi,
I have a file will 1000 lines.... I want to deleted some line in the file... like 800-850 lines i want to remove in that...
can somebody help me..?
thanks. (2 Replies)
hello everyone
my file contains many records, the following is a sample:
BEGIN
ASX1500000050002010120000000308450201012000177
ASX1100002000000201012000000038450201012000220
ASX1600100005000201012000000038450020101200177
ASX1900100006000201067000000058450020101200177... (2 Replies)
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)
Hi All,
This might be a basic question... I need to write a script to find all/any Speacial/Null/Control Chars and Print Line Numbers from an input file.
Output something like
Null Characters in File Name at : Line Numbers
Line = Print the line
Control Characters in File Name at : Line... (2 Replies)
Hi All,
i want to write a shell script read below file line by line and want to exclude the lines which contains empty value for MOUNTPOINT field.
i am using centos 7 Operating system.
want to read below file.
# cat /tmp/d5
NAME="/dev/sda" TYPE="disk" SIZE="60G" OWNER="root"... (4 Replies)
Discussion started by: balu1234
4 Replies
LEARN ABOUT OPENDARWIN
unexpand
EXPAND(1) BSD General Commands Manual EXPAND(1)NAME
expand, unexpand -- expand tabs to spaces, and vice versa
SYNOPSIS
expand [-t tab1,tab2,...,tabn] [file ...]
unexpand [-a] [-t tab1,tab2,...,tabn] [file ...]
DESCRIPTION
The expand utility processes the named files or the standard input writing the standard output with tabs changed into blanks. Backspace
characters are preserved into the output and decrement the column count for tab calculations. The expand utility is useful for pre-process-
ing character files (before sorting, looking at specific columns, etc.) that contain tabs.
The unexpand utility puts tabs back into the data from the standard input or the named files and writes the result on the standard output.
The following options are available:
-a (unexpand only) By default, only leading blanks and tabs are reconverted to maximal strings of tabs. If the -a option is given, then
tabs are inserted whenever they would compress the resultant file by replacing two or more characters.
-t tab1,tab2,...,tabn
Set tab stops at column positions tab1, tab2, ..., tabn. If only a single number is given, tab stops are set that number of column
positions apart instead of the default number of 8.
ENVIRONMENT
The LANG, LC_ALL and LC_CTYPE environment variables affect the execution of expand and unexpand as described in environ(7).
DIAGNOSTICS
The expand and unexpand utilities exit 0 on success, and >0 if an error occurs.
STANDARDS
The expand and unexpand utilities conform to IEEE Std 1003.1-2001 (``POSIX.1'').
HISTORY
The expand command appeared in 3.0BSD.
BSD April 21, 2002 BSD