Sponsored Content
Top Forums UNIX for Advanced & Expert Users AIX sed use space as delimiter Post 303043824 by cokedude on Friday 7th of February 2020 03:09:34 PM
Old 02-07-2020
AIX sed use space as delimiter

I am trying to do this with one small tweak. I would also like to use a space as a delimiter.

Code:
sed 's/[,.!?]  */\
/g' file

This is what my file looks like.

Code:
server1, server2, server3
server4 server5 server6

I would like it to look like this.

Code:
server1
server2
server3
server4 
server5 
server6

This was some of my ideas for a solution.
Code:
sed 's/[,.!? ]  */\
/g' file
server1
server2
server3
server4 server5 server6
sed 's/[,.!?  ]  */\
/g' file
server1
server2
server3
server4 server5 server6
sed 's/[,.!? ""]  */\
/g' file
server1
server2
server3
server4 server5 server6
sed 's/[,.!? " "]  */\
/g' file
server1
server2
server3
server4 server5 server6
sed 's/[,.!? '']  */\
/g' file
server1
server2
server3
server4 server5 server6
sed 's/[,.!? ' ']  */\
/g' file
sed: 0602-404 Function s/[,.!?  cannot be parsed.

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

replace space with delimiter in whole file -perl

Hi I have a file which have say about 100,000 records.. the records in it look like Some kind of text 1234567891 abcd February 14, 2008 03:58:54 AM lmnop This is how it looks.. if u notice there is a 2byte space between each column.. and im planning to replace that with '|' .. ... (11 Replies)
Discussion started by: meghana
11 Replies

2. UNIX for Dummies Questions & Answers

replacing space with pipe(delimiter)

Hello All, I have a file with thousands of records: eg: |000222|123456987|||||||AARONSON| JOHN P|||PRIMARY |P |000111|567894521|||||||ATHENS| WILLIAM k|||AAAA|L Expected: |000222|123456987|||||||AARONSON| JOHN |P|||PRIMARY |P |000111|567894521|||||||ATHENS| WILLIAM |k|||AAAA|L I... (6 Replies)
Discussion started by: OSD
6 Replies

3. UNIX for Dummies Questions & Answers

Problem Using Cut With A Space Delimiter

I am trying to extract 'postmaster' from the following string: PenaltyError:=554 5.7.1 Error, send your mail to postmaster@LOCALDOMAIN using the following command: cat /usr/share/assp/assp.cfg | grep ^PenaltyError:= | cut -d '@' -f1 | cut -f8 but it returns: PenaltyError:=554 5.7.1 Error,... (10 Replies)
Discussion started by: cleanden
10 Replies

4. UNIX for Dummies Questions & Answers

Delimiter: Tab or Space?

Hello, Is there a direct command to check if the delimiter in your file is a tab or a space? And how can they be converted from one to another. Thanks, G (4 Replies)
Discussion started by: Gussifinknottle
4 Replies

5. Shell Programming and Scripting

comma delimiter and space

I have a csv file and there is a problem which I need to resolve. Column1,Column2,Colum3,Column4 ,x,y,z ,d,c,v t,l,m,n ,h,s,k ,k,,y z,j, ,p Now if you see column1 for row 1 and row 4 though they are null there is a space but in case of row2 and row 5 there is no space. I want row... (3 Replies)
Discussion started by: RubinPat
3 Replies

6. Shell Programming and Scripting

Problem in extraction when space is a field delimiter

I have more than 1000 files to parse. Each file contains few lines (number of lines varies) followed by a header line having all column's name (SPOT, NAME etc) and then values for those columns. **Example File: sdgafh dfhaadfha sfgaf dhah jkthdj SPOT NAME GENE_NAME CH_MEAN CHDN_MED ... (11 Replies)
Discussion started by: AshwaniSharma09
11 Replies

7. Shell Programming and Scripting

Space as a delimiter

not sure if i'm doing this right i'm new tho this but i'm trying to use a space as a delimiter with the cut command my code is size=$( du -k -S -s /home/cmik | cut -d' ' -f1 ) i've also tried -f2 and switching the -d and -f around if that does anything (3 Replies)
Discussion started by: Cmik
3 Replies

8. Shell Programming and Scripting

using a another delimiter with sed?

Hi there, After lots of reading I figured out how to use sed to parse my file. This file is called services.txt: 00a1:ffff0000:0018:01f4:1:477 BravaNL 00a2:ffff0000:0018:01f4:1:471 MAX 00a3:ffff0000:000b:01f4:1:390 HaberTürk... (5 Replies)
Discussion started by: MastaG
5 Replies

9. Shell Programming and Scripting

Need next line as a space delimiter in awk

Hi,Below is the output for p3fi_dev services 1/app/oracle> . ./oraprofile_p3fi_dev p3fi_dev_01 (P):/devoragridcn_01/app/oracle> srvctl config service -d p3fi_dev p3fi_p3fi_dev.world PREF: p3fi_dev_01 AVAIL: p3fi_dev_02 pplnet_p3fidev PREF: p3fi_dev_01 AVAIL: p3fi_dev_02 nexus_p3fidev PREF:... (3 Replies)
Discussion started by: Vishal_dba
3 Replies

10. Shell Programming and Scripting

Need to use delimiter as : and space in awk

Hi , Please suggest me how do I use : (colon and one space) as a delimiter in awk Best regards, Vishal (2 Replies)
Discussion started by: Vishal_dba
2 Replies
ypserv(8yp)															       ypserv(8yp)

Name
       ypserv, ypbind - yellow pages (YP) server and binder processes

Syntax
       /usr/etc/ypserv
       /etc/ypbind [ -S domainname, servername1,servername2...	][ -X ]

Description
       The  yellow  pages (YP) service provides a network lookup service consisting of databases and processes.  The databases are files stored in
       the directory.  These files are described in The processes are the YP database lookup server, and the YP binder.  The software interface to
       the YP service is described in Administrative tools are described in and Tools to see the contents of YP maps are described in and Database
       generation and maintenance tools are described in and

       Both and are daemon processes activated at system startup time from The command runs only on a YP server machine with a complete  YP  data-
       base.  The command runs on all machines using YP services, both YP servers and clients.

       The  daemon's primary function is to look up information in its local database of YP maps.  The operations performed by are defined for the
       programmer in the header file

       Communication with is by means of RPC calls.  Lookup functions are described in and are supplied as C-callable functions in

       There are four lookup functions, all of which are performed on a specified map within a YP domain: and  The  operation  takes  a  key,  and
       returns	the  associated  value.  The operation returns the first key-value pair from the map, and the operation returns the remaining key-
       value pairs.  The operation ships the entire map to the requester.

       Two other functions supply information about the map, rather than the map entries: and Both the order number and the master name  exist	in
       the map as key-value pairs, but the server will not return either through the usual lookup functions.  If the map is examined with however,
       they are visible.

       Other functions are used within the YP subsystem itself, and are not of general interest to YP clients.	They include the the and the func-
       tions.

       The  purpose  of the function is to remember information that lets client processes on a single node communicate with a process.  The func-
       tion must run on every machine that has YP client service requirements.	The function must be started through an entry in the file.

       The information remembers is called a binding, the association of a domain name with the internet address of the YP server, and the port on
       that  host  at which the process is listening for service requests.  The process of binding is driven by client requests.  As a request for
       an unbound domain comes in, the process broadcasts on the net trying to find a process that serves maps	within	that  domain.	Since  the
       binding	is established by broadcasting, there must be at least one process on every net.  Once a domain is bound by a particular that same
       binding is given to every client process on the node.  The process on the local node or a remote node may be queried for the binding  of  a
       particular domain by using the command.

       Bindings  are  verified	before	they are given out to a client process.  If is unable to speak to the process it is bound to, it marks the
       domain as unbound, tells the client process that the domain is unbound, and tries to bind the domain once again.  Requests received for	an
       unbound	domain	will  fail immediately.  In general, a bound domain is marked as unbound when the node running crashes or gets overloaded.
       When the node gets overloaded, will try to bind any YP server (typically one that is less-heavily loaded) available on the net.

       The process also accepts requests to set its binding for a particular domain.  The request is usually generated by the YP subsystem itself.

Options
       -S	 Allows the system administrator to lock to a particular domain and set of servers. Up to four servers can be  specified  as  fol-
		 lows:
		 /etc/ypbind -S domainname,server1,server2,server3,server4
		 Note  that  there  can not be any spaces around the commas in the command line. The option ensures that this system only binds to
		 the specified domain and to one of the specified servers.  The servers used with the option must have entries in the local file.

       -X	 The initial bind ( option forces to bind to a YP server at the time that the command is executed, instead of waiting until YP	is
		 used.	If no server is available at this time, will try for several minutes and then exit.  Normally, is executed at boot time.

		 The  option  enables  a  system  that	does not exclusively depend on YP to boot and to allow logins when there are no YP servers
		 available.  Without this option, such a system hangs.

Files
       If the file exists when starts up, log information is written to when error conditions occur.

See Also
       ypcat(1yp), ypmatch(1yp), ypwhich(1yp), ypclnt(3yp), ypfiles(5yp), yppush(8yp), ypxfr(8yp)
       Guide to the Yellow Pages Service

																       ypserv(8yp)
All times are GMT -4. The time now is 01:46 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy