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).
EXIT STATUS
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 October 13, 2006 BSD
Check Out this Related Man Page
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).
EXIT STATUS
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 October 13, 2006 BSD
hi,
I have some 50 C files in which for indentation of code some devlopers used tabs, but we dont want any tab used for indentation.
I have following 2 need.
1) find tabs from all 50 files (which are in one directory )
2) replace them with 4 spaces.
Thanks
Rishi (6 Replies)
I am writing the below script to do a grep and count number of occurances between two tab delimited files.
I am trying to achieve..
1) Extract column 2 and column 3 from the S.txt file. Put it in a temp pattern file
2) Grep and count column 2 in D.txt file
3) Compare the counts between... (19 Replies)
I want to convert all leading tabs to spaces in all PHP files in a certain folder, recursively.
I have successfully used "expand" to do this on one file at a time by doing something like this:
expand -i file.php > file.php
How would I convert all leading tabs to spaces in all PHP... (4 Replies)
Hi ,
I have two tables with same length t1 and t2, I want to cretae a new third table where i put the difference between the elements of t2 and t1,
t3= t1 - t2
t3= t1 - t2
I am new to scripts, any help please? thanks (7 Replies)
Hi All,
I am getting a input file which doesnt have a field seperator. The file is being sorted on certain positions say from 0.55 to 0.59. If there are any blanks from 0.55 to 0.59 they will be listed as first set of records. I am not sure abt the number of records which will have blanks at... (8 Replies)
Hi All,
May I know how to expand the words?
e.g:
a
aa
aaa
aaaa
I have try to use
for (i=0;i<5;i++)
do
c="a"
echo -n $c
done
but the output is aaaaa. Is it need to use array?:confused:
Thanks for your help! (5 Replies)
Hi
I have an input file which have random file in between.I have to manipulate each line and replace the character from position 5-10 with XXXXXX.
But when I am writing this to on output file the tabs in between gets converted to normal space.
Input file :
14207531131040896334R108 ... (4 Replies)
When I do the who command it doesn't show all my info:
$w gscn
6:08PM up 4 days, 20:33, 177 users, load averages: 7.46, 3.78, 3.43
USER TTY FROM LOGIN@ IDLE WHAT
gscn R1 pool-92-199-17-1 5:46PM - w gscn
Like in the 'From' column.... (8 Replies)
I have following string in a variable:
str="sstring garbage adfsdf tab.col1 lkad rjfj tab2.col2 adja tab2.col4 garbage"
I want to filter "word.word" pattern from it. I assume the pattern won't occur in start or end of the string. Output shoud be:
tab.col1 tab2.col2 tab2.col4
Can this be... (7 Replies)
Hello,
so i'm making a script, using dynamic variables and trying to expand them. So far it hasn't worked out too well so it seems that I need some help from you, the elite.
Example:
#!/bin/sh
counter=0
until (($counter>5))
counter2=1
until (($counter2>6)); do
if ;... (5 Replies)
I want to know how can I remove all the tabs (\t) from a tab delimited file. In my file some of the rows only contain one column and rest are unoccupied but the tabs are there. When I performed some regular expressions to do substitutions like:
%s/\t/\/\/ /ig
all the hidden tabs are converted... (4 Replies)
Hello again,
I have example config file with two arrays:
tab1="name1 surname1"
tab1="name2 surname2"
tab1="name3 surname3"
tab2="First"
tab2="Second"and csv file:
"aaaaa","surname1","name1","ddddd,eeeee","ffffff","ggggg","3","2012/02/22 12:25:21","2012/02/22... (7 Replies)
I am trying to use awk to place the contens of a filename in $1 and $2 followed by the data in the text file. Basically, put the filename within the text file. There are over 1000 files in the directory and as of now each file is saved with a unique name but it is not within the file. Thank you... (10 Replies)