It doesn't print "extra" spaces, but the two leading spaces in the "id" line, which you do not remove with your sed command. Try again piping through
, i.e. include the spaces from line start...
Hi...
I am quite new to Unix and would like an issue to be resolved.
I have a file in the format below;
4,Reclaim,ECXTEST02,abc123,Harry Potter,5432 6730 0327 5469,0603,,MC,,1200,EUR,sho-001,,1,,,abc123,1223
I would like my output to be as follows;
4,Reclaim,ECXTEST02,abc123,Harry... (4 Replies)
Hi,
I need a help in deleting extra spaces in a text.
I have a huge file, a part of it is :-
3 09/21/08 03:32:07 started undef mino Oracle nmx004.wwdc.numonyx.com Message Text : The Oracle session with the PID 1103 has a CPU time ... (6 Replies)
Hi,
I have a source file as mentioned below: I want to remove all the extra spaces between the fields.
a b--------|sa df-------|3232---|3
sf sa------|afs sdf-----|43-----|33
a b c------|adfsa dsf---|23-32|23
*Here '-' idicates spaces
Now, I want output as below:
a b|sa df|3232|3... (7 Replies)
Hi,
I have a string like this and i want to remove extra spaces that exists between the words.
Here is the sentence.
$string="The small DNA genome of hepadnaviruses is replicated by reverse transcription via an RNA intermediate. This RNA "pregenome" contains ... (2 Replies)
HI,
I need the help from the experts like I have created one file with text like:
a b c d
e f g h
i j k l
So my question is that i have to write the script in which like in the first sentence it will take only one space after d and remove all the extra space in the end.I dont... (8 Replies)
hi I am on AIX 5 and i have a script that runs the following command to list processes running. I then want to kill the returned processes. The PID are on field 2 separated by spaces.
$ ps -ef|grep "rams.e $PORT"
lesqa 1826998 2646248 0 11:20:35 pts/2 0:00 grep rams.e
t24cm 2789380 ... (3 Replies)
hi,
i need to remove the extra spaces in the filed.
Sample:
abc~bd ~bkd123 .. 1space
abc~badf ~bakdsf123 .. 2space
abc~bqed ~bakuowe .. 3space
output:
abc~bd ~bkd123 .. 1space
abc~badf~bakdsf123 .. 2space
abc~bqed~bakuowe .. 3space
i used the following command, (2 Replies)
hi,
i need to remove the extra spaces in the 2nd field.
Sample:
abc|bd |bkd123 .. 1space
abc|badf |bakdsf123 .. 2space
abc|bqe |bakuowe .. 3space
Output:
abc|bd|bkd123
abc|badf|bakdsf123
abc|bqe|bakuowe
i used the following command, (9 Replies)
Hi,
I want to remove all extra spaces, line breaks .
Need a new line entry only for term starting"array"
For eg: my input is
array(),
array(),
array(),
and my expected output is
array(),
array(),
array(),
Is it possible using awk? (5 Replies)
Discussion started by: rsi.245
5 Replies
LEARN ABOUT DEBIAN
gofmt
GOFMT(1) General Commands Manual GOFMT(1)NAME
gofmt - formats Go programs
SYNOPSIS
gofmt [flags] [ path ... ]
DESCRIPTION
Without an explicit path, it processes the standard input. Given a file, it operates on that file; given a directory, it operates on all
.go files in that directory, recursively. (Files starting with a period are ignored.) By default, gofmt prints the reformatted sources to
standard output.
OPTIONS -d Do not print reformatted sources to standard output. If a file's formatting is different than gofmt's, print diffs to standard out-
put.
-e Print all (including spurious) errors.
-l Do not print reformatted sources to standard output. If a file's formatting is different from gofmt's, print its name to standard
output.
-r rule
Apply the rewrite rule to the source before reformatting.
-s Try to simplify code (after applying the rewrite rule, if any).
-w Do not print reformatted sources to standard output. If a file's formatting is different from gofmt's, overwrite it with gofmt's
version.
Formatting control flags:
-comments=true
Print comments; if false, all comments are elided from the output.
-tabs=true
Indent with tabs; if false, spaces are used instead.
-tabwidth=8
Tab width in spaces.
The rewrite rule specified with the -r flag must be a string of the form:
pattern -> replacement
Both pattern and replacement must be valid Go expressions. In the pattern, single-character lowercase identifiers serve as wildcards match-
ing arbitrary sub-expressions; those expressions will be substituted for the same identifiers in the replacement.
When gofmt reads from standard input, it accepts either a full Go program or a program fragment. A program fragment must be a syntactically
valid declaration list, statement list, or expression. When formatting such a fragment, gofmt preserves leading indentation as well as
leading and trailing spaces, so that individual sections of a Go program can be formatted by piping them through gofmt.
EXAMPLES
To check files for unnecessary parentheses:
gofmt -r '(a) -> a' -l *.go
To remove the parentheses:
gofmt -r '(a) -> a' -w *.go
To convert the package tree from explicit slice upper bounds to implicit ones:
gofmt -r 'a[B:len(a)] -> a[B:]' -w $GOROOT/src/pkg
BUGS
The implementation of -r is a bit slow.
AUTHOR
This manual page was written by Michael Stapelberg <stapelberg@debian.org>, for the Debian project (and may be used by others).
2012-05-13 GOFMT(1)