The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Removing trailing spaces from delimited files djkane Shell Programming and Scripting 6 03-29-2006 06:11 AM
Removing page space srnkumar AIX 4 01-05-2006 05:04 AM
Removing leading and trailing spaces of data between the tags in xml. jhmr7 UNIX for Dummies Questions & Answers 2 05-18-2005 10:27 AM
Removing Space at the end of file rkumar28 Shell Programming and Scripting 4 03-03-2005 09:42 AM
removing trailing spaces of a particular column in a file rooh UNIX for Dummies Questions & Answers 2 01-12-2002 11:34 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 06-18-2003
oombera's Avatar
oombera oombera is offline Forum Advisor  
Registered User
  
 

Join Date: Aug 2002
Location: Cleveland, OH
Posts: 804
re: removing trailing space from lines

Quote:
Originally posted by sameerbo
Hi,

How can we remove the all trailing spaces of a line from a file.


TiA
Sameer.
Not sure why this thread was closed without any explanation, but you can do what you're asking with sed 's/[[:blank:]]*$//g' < sourceFile > destFile
  #2 (permalink)  
Old 06-19-2003
sameerbo sameerbo is offline
Registered User
  
 

Join Date: Jun 2003
Location: Delhi, India
Posts: 3
Thank You! oombera, for answering the query.
I really appreciate your effort to answer, even the closed thread.

I was going through the various threads after posting my query.
there was one thread 'Remove Last Character of Line'. this was pretty similar query. I got the answer for my query from this thread.

And that is why i closed the thread.

I just tried this syntax but it doesn't work. I am working on solaris 5.8. And I am not sure whether this syntax works on other platform. may be this is the case, that, it work on some other platform.

I used this syntax.
---------------------------------------------
sed 's/ *$//g' < file_tailing_spaces
---------------------------------------------
Notice that it has two spaces preceeding '*$'
Actually, I have file which has more than one trailing spaces. It worked.

Thank You! Once Again.
Sameer.
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 09:21 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0