Sponsored Content
Top Forums Shell Programming and Scripting Sed: Remove whitespace between two strings Post 302490989 by glev2005 on Wednesday 26th of January 2011 11:20:20 AM
Old 01-26-2011
I ended up using a while loop

Code:
grep -A2 -B2 ^cd '/home/gregg/Desktop/mp3-to-m4b-batch1'|while read line ; do echo ${line}\/mp3;done >>mp3-to-m4b-batch2

---------- Post updated at 10:48 AM ---------- Previous update was at 10:48 AM ----------

Thanks Perderabo, I am going to study your code and learn from it.

---------- Post updated at 11:20 AM ---------- Previous update was at 10:48 AM ----------

Perdabo, can you explain your code please? that is the s=\ ? Is that specifying a delimiter of a backslash?
 

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
Perl::Critic::Policy::ValuesAndExpressions::ProhibitNoisUsertContributed Perl Perl::Critic::Policy::ValuesAndExpressions::ProhibitNoisyQuotes(3pm)

NAME
Perl::Critic::Policy::ValuesAndExpressions::ProhibitNoisyQuotes - Use "q{}" or "qq{}" instead of quotes for awkward-looking strings. AFFILIATION
This Policy is part of the core Perl::Critic distribution. DESCRIPTION
Don't use quotes for one or two-character strings of non-alphanumeric characters (i.e. noise). These tend to be hard to read. For legibility, use "q{}" or a named value. However, braces, parentheses, and brackets tend do to look better in quotes, so those are allowed. $str = join ',', @list; #not ok $str = join ",", @list; #not ok $str = join q{,}, @list; #better $COMMA = q{,}; $str = join $COMMA, @list; #best $lbrace = '('; #ok $rbrace = ')'; #ok print '(', @list, ')'; #ok CONFIGURATION
This Policy is not configurable except for the standard options. SEE ALSO
Perl::Critic::Policy::ValuesAndExpressions::ProhibitEmptyQuotes AUTHOR
Jeffrey Ryan Thalhammer <jeff@imaginative-software.com> COPYRIGHT
Copyright (c) 2005-2011 Imaginative Software Systems. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. The full text of this license can be found in the LICENSE file included with this module. perl v5.14.2 2012-06-07Perl::Critic::Policy::ValuesAndExpressions::ProhibitNoisyQuotes(3pm)
All times are GMT -4. The time now is 12:16 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy