05-04-2006
To remove the extra spaces in unix
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 Potter,5432673003275469, 0603,,MC,,1200,EUR,sho-001,,1,,,abc123,1223
i.e i want the inbetween spaces from the 6th field to be removed.
Please do help
Thanks in advance
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
All...
I want to remove blank spaces in file . I just leraned that we can use
" cat <Input filename> | tr -s ‘ ‘ > <Target file name> "
i also know with SED we can replace a blank space by other character by
sed s/ /*/g filename.
Please let me know how can i do that by... (1 Reply)
Discussion started by: arunkumar_mca
1 Replies
2. Shell Programming and Scripting
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)
Discussion started by: vikas027
6 Replies
3. Shell Programming and Scripting
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)
Discussion started by: srilaxmi
7 Replies
4. Shell Programming and Scripting
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)
Discussion started by: vanitham
2 Replies
5. Shell Programming and Scripting
Suppose, I have a variable var=" name is ".
I want to remove the blank spaces from the begining and endonly, not from the entire string.
So, that the variable/string looks like following
var="name is".
Please look after the issue. (3 Replies)
Discussion started by: mady135
3 Replies
6. Shell Programming and Scripting
I have a file which contains certain records about users. the row length is always fixed to 205 characters.
Now I want to read each record line from the file, substring some portion out of it and put into another file. But I have observed that my script is trimming the extra spaces I have used for... (4 Replies)
Discussion started by: Pramit
4 Replies
7. Shell Programming and Scripting
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)
Discussion started by: bhanudhingra
8 Replies
8. Shell Programming and Scripting
Hi guru's,
I am trying to write a script to generate a csv file by connecting to database run a query and put the values into csv file.
But the problem i face is i am getting lot of space after one value.how can i remove those values?.
Please help.
#!/bin/bash
export... (2 Replies)
Discussion started by: karingulanagara
2 Replies
9. UNIX Desktop Questions & Answers
I have a file of about 10k records and eace line is having an extra space of 5 byte at the end.. Iwant to remove the extra spaces at the end of each line.. Can someone please help me out.. I tried using sed command and its not working... can someone please help me out. (3 Replies)
Discussion started by: rammohan
3 Replies
10. UNIX for Beginners Questions & Answers
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
user_clusters
USER_CLUSTERS(5) Debian PostgreSQL infrastructure USER_CLUSTERS(5)
NAME
user_clusters - File linking users to PostgreSQL clusters
DESCRIPTION
This file maps users against the database clusters to which they will connect by default. However, every user can override these settings
in ~/.postgresqlrc.
When scanning this file, the first matching line will be used. It is a good idea to provide a default explicitly, with a final line where
both user and group are set to *.
If there is no default, the implicit default is to connect to the cluster whose postmaster is listening on port 5432 and to the database
matching the user's login name.
FORMAT
Comments are introduced by the character #. Comments may follow data on a line; the first comment character terminates the data. Leading
whitespace and blank lines are ignored.
Each uncommented, non-blank line must describe a user, group or the default (where both user and group are set to *).
Fields must be given in the following order, separated by white space:
USER The login id of the Unix user to whom this line applies. The wildcard character * means any user.
GROUP The group name of the Unix group to which this line applies. The wildcard character * means any group.
VERSION
The major PostgreSQL version of the cluster to connect to.
CLUSTER
The name of a cluster to connect to. A remote cluster is specified with host:port. If port is empty, it defaults to 5432.
DATABASE
Within the cluster, the database to which the user will connect by default if he does not specify a database on the command line.
If this is *, the default database will be the one named by the user's login id.
NOTES
Since the first matching line is used, the default line must come last.
SEE ALSO
pg_wrapper(1), postgresqlrc(5)
Debian Feburary 2005 USER_CLUSTERS(5)