Sponsored Content
Top Forums Shell Programming and Scripting Sed: Remove whitespace between two strings Post 302491199 by michaelrozar17 on Thursday 27th of January 2011 01:41:55 AM
Old 01-27-2011
another sed solution..
Code:
echo "cd media/Audio/WAVE/9781933976334    /mp3"|sed 's/ \+//2'

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

remove whitespace and test

Hi, I know removing whitespaces I can found so many threads to read how it works and i did it, but my problem isn't solved... I have in my script a variable $1 which can contains a text like " Channel ". No I want to check if $1 contains the word Channel, but I don't know how many... (4 Replies)
Discussion started by: bensky
4 Replies

2. Shell Programming and Scripting

sed : remove whitespace

I'm trying to remove the whitespace at the end of each line of a text file in ksh. Im using sed s/ $//g' file1.txt > file2.txt It's not working. Any clues? (3 Replies)
Discussion started by: b.hamilton
3 Replies

3. UNIX for Dummies Questions & Answers

remove whitespace

I combined 2 files using the paste command. It gave me something like this: 123445 ,AABBNN 22344 ,BBVVMM I want to remove the whitespace between the end of string 1 and the comma (there is more blank space than my post is showing). Would I... (2 Replies)
Discussion started by: nickg
2 Replies

4. Shell Programming and Scripting

sed: remove characters between and including 2 strings

I have the following line: 4/23/2010 0:00:38.000: Copying $$3MSYDDC02$I would like to use sed (or similiar) to remove everthing between and including $ that appears in the line so it ends up like this. 4/23/2010 0:00:38.000: Copying 3MSYDDC02I have been trying these but i'm really just... (5 Replies)
Discussion started by: jelloir
5 Replies

5. Shell Programming and Scripting

Remove strings within range using sed

Hey folks I have a big file that contains junk data between the tags <point> and </point> and I need to delete it (including `<point>' and `</point>'). i.e. a = 1 <point> 123123 2342352 234231 234256 </point> print a needs to become a = 1 print a I'm certain that this is a... (10 Replies)
Discussion started by: ksk
10 Replies

6. Shell Programming and Scripting

any savant ? using AWK/SED to remove newline character between two strings : conditional removal

I'd like to remove (do a pattern or precise replacement - this I can handle in SED using Regex ) ---AFTER THE 1ST Occurrence ( i.e. on the 2nd occurrence - from the 2nd to fourth occurance ) of a specific string : type 1 -- After the 1st occurrence of 1 string1 till the 1st occurrence of... (4 Replies)
Discussion started by: sieger007
4 Replies

7. Shell Programming and Scripting

awk or sed script to remove strings

Below am trying to separate FA-7A:1, In output file it should display 7A 1 Command am using Gives same output as below format: 22B7 10000000c9720873 0 22B7 10000000c95d5d8b 0 22BB 10000000c97843a2 0 22BB 10000000c975adbd 0 Not showing FA ports as required format... (5 Replies)
Discussion started by: aix_admin_007
5 Replies

8. UNIX for Dummies Questions & Answers

[Solved] How remove leading whitespace from xml (sed /awk?)

Hi again I have an xml file and want to remove the leading white space as it causes me issues later in my script I see sed is possible but cant seem to get it to work I tried sed 's/^ *//' file.xml output <xn:VsDataContainer id="1U104799" modifier="update"> ... (10 Replies)
Discussion started by: aniquebmx
10 Replies

9. Shell Programming and Scripting

USING sed to remove multiple strings/words from a line

Hi I use sed comnand to remove occurance of one workd from a line. However I need to removed occurance of dufferent words in ne line. Original-1 Hi this is the END of my begining Comand sed s/"END"/"start"/g Output-1 Hi this is the start of my beginig But I have more... (9 Replies)
Discussion started by: mnassiri
9 Replies

10. UNIX for Beginners Questions & Answers

How to append strings with whitespace?

Hi, Need help. This seems simple but I tried many things but failed to get what I wanted. Below is the input file: ... (7 Replies)
Discussion started by: bunny_merah19
7 Replies
CTYPE_SPACE(3)								 1							    CTYPE_SPACE(3)

ctype_space - Check for whitespace character(s)

SYNOPSIS
bool ctype_space (string $text) DESCRIPTION
Checks if all of the characters in the provided string, $text, creates whitespace. PARAMETERS
o $text - The tested string. RETURN VALUES
Returns TRUE if every character in $text creates some sort of white space, FALSE otherwise. Besides the blank character this also includes tab, vertical tab, line feed, carriage return and form feed characters. EXAMPLES
Example #1 A ctype_space(3) example <?php $strings = array('string1' => " ", 'string2' => " arf12", 'string3' => ' '); foreach ($strings as $name => $testcase) { if (ctype_space($testcase)) { echo "The string '$name' consists of all whitespace characters. "; } else { echo "The string '$name' does not consist of all whitespace characters. "; } } ?> The above example will output: The string 'string1' consists of all whitespace characters. The string 'string2' does not consist of all whitespace characters. The string 'string3' does not consist of all whitespace characters. NOTES
Note If an integer between -128 and 255 inclusive is provided, it is interpreted as the ASCII value of a single character (negative val- ues have 256 added in order to allow characters in the Extended ASCII range). Any other integer is interpreted as a string contain- ing the decimal digits of the integer. SEE ALSO
ctype_cntrl(3), ctype_graph(3), ctype_punct(3). PHP Documentation Group CTYPE_SPACE(3)
All times are GMT -4. The time now is 10:33 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy