...
I am having problem in substitution of any number of spaces, or a combination of space and tab in between strings in the lines of text file. Is there any way out in Perl?
...
Folks, I am wondering if anyone solve this problem.
What I want to know is,
1. Delete all white spaces including leading blank space in each line (e.g. line 2), and replace such spaces by single tab except leading blank space
2. Then, align all columns to the right. But, output white space... (1 Reply)
hi every one
plz help me
i want to search for a line contains tabspace
This is a line The should be changed
see the above line is seperated with tab space i want to replace that tab space in to # as
This is a line#The should be changed
i have tried with... (4 Replies)
I am searching while I await a response to this so if it has been asked already I apologize.
I have a file with lines in it that look like:
bob johnson email@email.org
I need it to look like:
bob:johnson:email@email.org
I am trying to use sed like this:
sed -e 's/ /:/g' file >... (5 Replies)
Hello All,
I am trying to remove all tabspaces and all blankspaces from my file using sed & awk, but not getting proper code. Please help me out.
My file is like this (<b> means one blank space, <t> means one tab space)-
$ cat file
NARESH<b><b><b>KUMAR<t><t>PRADHAN... (3 Replies)
my content:
samaccountname employeeid useraccountcontrol description
i want it to look like this:
"samaccountname","employeeid","useraccountcontrol","description" (2 Replies)
Dear Gurus
Can you please advise me on how to Replace all TAB characters with white spaces in a text file in AIX?
Either using vi or any utilities (2 Replies)
How to catch a two word keyword which may contain a new line(may include spaces or tab) in it.
for example there is a file a.txt.
$more a.txt
create view
as
(select from
.........
..........
( select
....
(
select
......
..
select only no (((
number
( select
end (12 Replies)
Hi
I have no experience in Unix so any help would be appreciated
I have the flowing text
235543
123
45654
199
225
578
45654
199
225
I need to find this sequence from A file
45654
199
225 (22 Replies)
I have a file which contains the data lines like below.I want to remove the tab spaces at the end of each line.I have tried with the command sed 's/\+$//' file.but it does not work.Can anyone help me on this?
15022 15022 15022 15022 15022 15022
15023 15023 15023 15023 15023 ... (16 Replies)
Discussion started by: am24
16 Replies
LEARN ABOUT OPENDARWIN
fmt
FMT(1) BSD General Commands Manual FMT(1)NAME
fmt -- simple text formatter
SYNOPSIS
fmt [-cmnps] [-d chars] [-l num] [-t num] [goal [maximum] | -width | -w width] [file ...]
DESCRIPTION
The fmt utility is a simple text formatter which reads the concatenation of input files (or standard input if none are given) and produces on
standard output a version of its input with lines as close to the goal length as possible without exceeding the maximum. The goal length
defaults to 65 and the maximum to 10 more than the goal length. Alternatively, a single width parameter can be specified either by prepend-
ing a hyphen to it or by using -w. For example, ``fmt -w 72'', ``fmt -72'', and ``fmt 72 72'' all produce identical output. The spacing at
the beginning of the input lines is preserved in the output, as are blank lines and interword spacing. Lines are joined or split only at
white space; that is, words are never joined or hyphenated.
The options are as follows:
-c Center the text, line by line. In this case, most of the other options are ignored; no splitting or joining of lines is done.
-m Try to format mail header lines contained in the input sensibly.
-n Format lines beginning with a '.' (dot) character. Normally, fmt does not fill these lines, for compatibility with nroff(1).
-p Allow indented paragraphs. Without the -p flag, any change in the amount of whitespace at the start of a line results in a new para-
graph being begun.
-s Collapse whitespace inside lines, so that multiple whitespace characters are turned into a single space. (Or, at the end of a sen-
tence, a double space.)
-d chars
Treat the chars (and no others) as sentence-ending characters. By default the sentence-ending characters are full stop ('.'), ques-
tion mark ('?') and exclamation mark ('!'). Remember that some characters may need to be escaped to protect them from your shell.
-l number
Replace multiple spaces with tabs at the start of each output line, if possible. Each number spaces will be replaced with one tab.
The default is 8. If number is 0, spaces are preserved.
-t number
Assume that the input files' tabs assume number spaces per tab stop. The default is 8.
The fmt utility is meant to format mail messages prior to sending, but may also be useful for other simple tasks. For instance, within vis-
ual mode of the ex(1) editor (e.g., vi(1)) the command
!}fmt
will reformat a paragraph, evening the lines.
SEE ALSO mail(1), nroff(1)HISTORY
The fmt command appeared in 3BSD.
The version described herein is a complete rewrite and appeared in FreeBSD 4.4.
AUTHORS
Kurt Shoens
Liz Allen (added goal length concept)
Gareth McCaughan
BUGS
The program was designed to be simple and fast - for more complex operations, the standard text processors are likely to be more appropriate.
When the first line of an indented paragraph is very long (more than about twice the goal length), the indentation in the output can be
wrong.
The fmt utility is not infallible in guessing what lines are mail headers and what lines are not.
BSD June 25, 2000 BSD