![]() |
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 |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Stripping the spaces in a string variable | rag84dec | Shell Programming and Scripting | 3 | 03-27-2008 03:16 AM |
| ksh - read file with leading spaces | momi | Shell Programming and Scripting | 2 | 03-17-2008 03:02 PM |
| remove leading spaces from a line | lijojoseph | Shell Programming and Scripting | 6 | 03-17-2008 05:29 AM |
| 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 |
| Leading and Trailing Spaces | sleepster | Shell Programming and Scripting | 7 | 10-29-2003 11:48 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
Stripping leading spaces on right justified name
I have a name field in a file which is right justified (yep - its true). I need to strip the leading spaces from the field and write the name out left justified. Again, I think I need to use a sed or awk command but so far, my results are at best disappointing. Thank you in advance from a UNIX newbie.
I need to leave the other fields intact, even if they have spaces. Is there no way to give a start and end position for a UNIX command to look at ? Thanks MArcia P |
|
||||
|
Does this file have set columns? If so you could use awk to extract the last field in the file. If so, then you can use awk like this, if not, I'll defer until more info is provided:
cat file | awk '{print $5}' where $5 is the fifth column in the file. |
| Sponsored Links | ||
|
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|