Sponsored Content
Full Discussion: remove spaces between tags
Top Forums Shell Programming and Scripting remove spaces between tags Post 302549229 by durden_tyler on Monday 22nd of August 2011 10:00:34 AM
Old 08-22-2011
Or with Perl:

Code:
$
$
$ cat data.txt
<RMService>
       <ResControl>
               <ResultCode>FATAL</ResultCode>
               <ServiceTime>38</ServiceTime>
               <DWLControl>
                       <requesterLanguage>100</requesterLanguage>
                       <requesterLocale>en</requesterLocale>
                       <requesterName>NCO A Batch Load</requesterName>
                       <requestID>4</requestID>
               </DWLControl>
       </ResControl>
<RMService>
$
$
$ perl -plne 'BEGIN {$/=""} s/>\s*</></g' data.txt
<RMService><ResControl><ResultCode>FATAL</ResultCode><ServiceTime>38</ServiceTime><DWLControl><requesterLanguage>100</requesterLanguage><requesterLocale>en</requesterLocale><requesterName>NCO A Batch Load</requesterName><requestID>4</requestID></DWLControl></ResControl><RMService>
$
$

tyler_durden
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Remove spaces from columns

I have a file with only one field something like this : 213.45 220.65 240.47 345.67 320.45 I want to remove all spaces in between. Is there any unix command for that ?Thanks in advance.. (2 Replies)
Discussion started by: jacks
2 Replies

2. UNIX for Dummies Questions & Answers

remove spaces btw

filename contains: 123 4 1234 5 12345 689 i want result: 1234 12345 12345679 cat filename | awk '{print $1, $2, $3}' will get my result, but too many $$s. sed -e 's///g' filename will take care one space, will take 2 spaces. is it a short way to do this ? (7 Replies)
Discussion started by: tjmannonline
7 Replies

3. Shell Programming and Scripting

Remove spaces before a delimiter

Hi All, I need to modify a script to remove spaces from a csv file. The csv file is delimited by the '~' character and I need to remove the spaces which appear before this character. i.e Sample input: LQ001 SWAT 11767727 ~9104 ~001 ~NIRSWA TEST 18 ~2 ~Standard Test ~0011 Desired... (5 Replies)
Discussion started by: SRyan84
5 Replies

4. Shell Programming and Scripting

Remove Spaces

Hi All, I have a comma seperated file. I wanna remove the spaces from column 2. I mean i don't wanna remove the spaces those are presnt in column 1. ex: emp name, emp no, salary abc k, abc 11, 1000 00 bhk s, bhk 22, 2000 00 the output should be: emp name, emp no, salary abc k, abc11,... (4 Replies)
Discussion started by: javeed7
4 Replies

5. Shell Programming and Scripting

Remove spaces in filenames

Hi, I have files like below, In files coming as spaces. Before transfering those files into ftp server. I want to remove the spaces and then can transfer the files into unix server. e.g: filenames are 1) SHmail _profile001_20120908.txt 2) SHmail_profile001 _20120908.txt 3) sh... (3 Replies)
Discussion started by: kirankumar
3 Replies

6. Shell Programming and Scripting

remove spaces

Hi folks, I need to remove spaces at the end of each line in a *.txt file. it looks like this word 1 word 2 . . . word n i found some sed commands but any of them didnt work so far thank you for your posts (6 Replies)
Discussion started by: Jimmy7
6 Replies

7. Shell Programming and Scripting

How to remove spaces on a line?

Hi, suppose I have the following data: albert music=top40 age=20 bob music=punk rock age=25 candy music=r n b age=22 dave music=mozart or bach only age=30 I want to extract and manipulate the music column but it's got spaces in it. How can I substitute the space with an underscore... (2 Replies)
Discussion started by: almonds
2 Replies

8. Shell Programming and Scripting

Remove spaces from the file

Hi All, The output file contains data as below. "20141023","CUSTOMER" ,"COMPANY" ,"IN0515461" ,"" ,"JOSHUA" There are spaces in between the ending " and ,. The number of spaces is random. How can I remove that from the file so that the final output is:... (4 Replies)
Discussion started by: aarsh.dave
4 Replies

9. UNIX for Dummies Questions & Answers

Remove blank spaces

Dear Masters, I want to remove all lines with blank spaces input file: a|abc|0|1 a|abc|2|3 b||3|5 c|def||7 d|def|0|1 Expected: a|abc|0|1 a|abc|2|3 d|def|0|1 I did this awk -F'|' '!/^$/' input (4 Replies)
Discussion started by: radius
4 Replies

10. Shell Programming and Scripting

Trying to remove leading spaces

OS : RHEL 6.7 Shell : bash I am trying to remove the leading the spaces in the below file $ cat pattern2.txt hello1 hello2 hello3 hello4 Expected output is shown below. $ cat pattern2.txt hello1 hello2 hello3 hello4 (2 Replies)
Discussion started by: John K
2 Replies
Courier::Config(3pm)					User Contributed Perl Documentation				      Courier::Config(3pm)

NAME
Courier::Config - Class providing configuration information for Perl modules related to the Courier MTA SYNOPSIS
use Courier::Config; # Courier base configuration: my $config_dir = Courier::Config->config_dir; my $runtime_dir = Courier::Config->runtime_dir; my $courier_executable = Courier::Config->courier_executable; my $courier_version = Courier::Config->courier_version; # Courier::Filter configuration: my $filter_conf_file = Courier::Config->filter_conf_file; DESCRIPTION
This class provides configuration information for Perl modules related to the Courier MTA, e.g. installation specific file system paths. Courier base configuration The following methods provide information about Courier's base configuration: config_dir: returns string The base configuration directory of Courier. runtime_dir: returns string The directory where Courier keeps the message queue ("msgq", "msgs", "tmp") and courierfilter sockets ("filters", "allfilters"). courier_executable: returns string The full path of the Courier daemon executable. courier_version: returns version The version number of the Courier installation. Courier::Filter configuration The following Courier::Filter configuration information is provided: filter_conf_file: returns string The absolute file name of the Courier::Filter courier-filter-perl configuration file. SEE ALSO
For AVAILABILITY, SUPPORT, and LICENSE information, see Courier::Filter::Overview. AUTHOR
Julian Mehnle <julian@mehnle.net> perl v5.14.2 2011-12-27 Courier::Config(3pm)
All times are GMT -4. The time now is 11:35 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy