![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| 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 |
| To Trim spaces at the end of line | sbasetty | Shell Programming and Scripting | 1 | 01-31-2007 10:01 PM |
| Strip leading and trailing spaces only in a shell variable with embedded spaces | jerardfjay | Shell Programming and Scripting | 6 | 03-07-2005 02:24 PM |
| Adding Trailing Spaces to a file | 222001459 | UNIX for Dummies Questions & Answers | 1 | 11-04-2004 03:23 PM |
| Leading and Trailing Spaces | sleepster | Shell Programming and Scripting | 7 | 10-29-2003 11:48 PM |
| removing trailing spaces of a particular column in a file | rooh | UNIX for Dummies Questions & Answers | 2 | 01-12-2002 11:34 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
hi,
The following can be accomplised using Perl script also [code] open(i,"<$filein") || die "Can't open $!\n "; while (!eof(i)) { $line = <i>; push @temp, $line; } close(i); foreach $line(@temp) { $line =~ s/\s+$//o; } [\code] Thanks, Raj |
|
||||
|
Quote:
Code:
>>> for lines in open("yourfile.txt"):
>>> print lines.strip()
|
![]() |
| Bookmarks |
| Tags |
| awk, awk trim, trim, trim awk |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|