Sponsored Content
Top Forums Shell Programming and Scripting Removing trailing spaces from delimited files Post 302069758 by shriashishpatil on Wednesday 29th of March 2006 04:34:24 AM
Old 03-29-2006
try to concentrate on regex "[' ']*|". It means zero or more spaces followes by bar "|".

"[' ']*|" is replaced by "|".

hope its clear now.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

removing trailing spaces of a particular column in a file

Hi, I am currently confused. Suppose I have a file something like the one below. 4299|raj Telecommunications|12||||| 4302|anjali International Ltd.|86|ritchie||dong|(000)2890 9993 |(222)4881 3689 4305|フィデュシアリ・ト-スト・インター...ショ...ル投資顧問株式会社 |112||||01-9211-1931 |08-3677-1985 Now... (2 Replies)
Discussion started by: rooh
2 Replies

2. Shell Programming and Scripting

Leading and Trailing Spaces

Hi, how to i remove leading and trailing spaces from a line? the spaces can be behind or in front of any field or line example of a line in the input data: Amy Reds , 100 , /bin/sh how to i get it to be: Amy Read,100,/bin/sh i saw something on this on the Man pages for AWK... (7 Replies)
Discussion started by: sleepster
7 Replies

3. Shell Programming and Scripting

Strip leading and trailing spaces only in a shell variable with embedded spaces

I am trying to strip all leading and trailing spaces of a shell variable using either awk or sed or any other utility, however unscuccessful and need your help. echo $SH_VAR | command_line Syntax. The SH_VAR contains embedded spaces which needs to be preserved. I need only for the leading and... (6 Replies)
Discussion started by: jerardfjay
6 Replies

4. UNIX for Dummies Questions & Answers

Removing leading and trailing spaces of data between the tags in xml.

I am having xml document as below. <transactionid> 00 </transactionid> <tracknumber> 0 </tracknumber> <key> N/A </key> But the data contains leading and trailing spaces between the tags. Please let me know how can i remove these leading and trailing spaces between the tags.... (2 Replies)
Discussion started by: jhmr7
2 Replies

5. UNIX for Dummies Questions & Answers

How to remove trailing spaces

Hi, I have a file like this (ADD_MONTHS((Substr(Trim(BOTH FROM Translate(Maximum(closeDa ------------------------------------------------------------ 2007-06-30 00:00:00 I have a requirement where i need just the date. When i do: tail -1... (2 Replies)
Discussion started by: mahek_bedi
2 Replies

6. Shell Programming and Scripting

Removing leading and trailing spaces only in PERL

Hi All, I have a file with the following contents with multiple lines 172445957| 000005911|8| 400 Peninsula Ave.#1551 | And,K |935172445957|000005911 607573888 |000098536 | 2|Ane, B |J |Ane |1868 |19861206|20090106|20071001 I want to trim the "leading and trailing spaces only" from... (2 Replies)
Discussion started by: kumar04
2 Replies

7. Shell Programming and Scripting

parsing log files, removing spaces and replace with commas

Hello all i am working on a database to import log files from my systems, but i cannot seem to find the answer. I searched here for a good bit and couldnt peice together what i was looking for. I know you could do this with awk, i just dont know how. Any help would be greatly appreciated.... (6 Replies)
Discussion started by: caddyjoe77
6 Replies

8. UNIX for Dummies Questions & Answers

Removing blank spaces from text files in UNIX

Hello, I am an super newbie, so forgive my sheer ignorance. I have a series of text files formatted as follows (just showing the header and first few lines): mean_geo mean_raw lat lon 0.000 0 -70.616 163.021 0.000 0 -70.620 163.073 0.000 ... (8 Replies)
Discussion started by: vtoniolo
8 Replies

9. Shell Programming and Scripting

[solved] Trailing spaces

Hello People How to check whether lines in a text file have trailing spaces or not and if a line have trailing spaces then how many trailing spaces line have? Regards ARvind kumar (5 Replies)
Discussion started by: arvindk.monu
5 Replies

10. UNIX for Dummies Questions & Answers

Want to add trailing spaces to the variable

I want to keep string/varible length to 10 even its actual length is less than 10(may be no value). so, i want to add trailing spaces to my string. :wall: "typeset -L10 myvarible" is not working, its saying invalid typset -L option. Can you please advise. (4 Replies)
Discussion started by: djaks111
4 Replies
Mail::Milter::Module::ConnectRegex(3pm) 		User Contributed Perl Documentation		   Mail::Milter::Module::ConnectRegex(3pm)

NAME
Mail::Milter::Module::ConnectRegex - milter to accept/reject connecting hosts matching regex(es) SYNOPSIS
use Mail::Milter::Module::ConnectRegex; my $milter = new Mail::Milter::Module::ConnectRegex('^foo$'); my $milter2 = &ConnectRegex(qw{^foo$ ^bar$}); # convenience $milter2->set_message('Connections from %H disallowed'); DESCRIPTION
This milter module rejects any connecting host whose hostname or IP address matches user-supplied regular expressions. It can also func- tion as a whitelisting Chain element; see "accept_match()". METHODS
new(REGEX[, ...]) Accepts one or more regular expressions, as strings or qr// precompiled regexes. They are tested in sequence, and the first match ter- minates checking. Note that all IP address literals will be enclosed in [square brackets]; so to test an IP address rather than a hostname, ensure those brackets exist: ^[ADDRESS]$ accept_match(FLAG) If FLAG is 0 (the default), a matching regex will cause the connection to be rejected. If FLAG is 1, a matching regex will cause this module to return SMFIS_ACCEPT instead. This allows a "ConnectRegex" to be used inside a "Mail::Milter::Chain" container (in accept_break(1) mode), to function as a whitelist rather than a blacklist. This method returns a reference to the object itself, allowing this method call to be chained. set_message(MESSAGE) Sets the message used when rejecting connections. This string may contain the substring %H, which will be replaced by the matching hostname or IP address. This method returns a reference to the object itself, allowing this method call to be chained. BUGS
In Sendmail 8.11 and 8.12, a milter rejection at "connect" stage does not allow the reply message to be set -- it simply becomes "not accepting messages". However, this module still attempts to set the reply code and message in the hope that this will be fixed. AUTHOR
Todd Vierling, <tv@duh.org> <tv@pobox.com> SEE ALSO
Mail::Milter::Object perl v5.8.8 2004-02-26 Mail::Milter::Module::ConnectRegex(3pm)
All times are GMT -4. The time now is 08:31 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy