![]() |
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 |
| adding spaces for a variable value | dnat | Shell Programming and Scripting | 2 | 02-26-2008 05:32 AM |
| Adding spaces to record | nvenkat010 | Shell Programming and Scripting | 3 | 01-28-2008 01:24 PM |
| Adding an extra route to the ip routing table | Japie89 | IP Networking | 2 | 10-18-2007 08:16 PM |
| adding spaces to a line | mgirinath | Shell Programming and Scripting | 4 | 03-23-2007 12:38 PM |
| Adding Trailing Spaces to a file | 222001459 | UNIX for Dummies Questions & Answers | 1 | 11-04-2004 03:23 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Adding character to spaces in a table
Hi All,
I am trying to get the spaces in the below table to be fill up with a character " - ". For eg, coordinates 0202 is a space but i would want to fill up with " - ". Can anybody help ? Input: Code:
04 D H 03 C G K 02 B L 01 A E I 01 02 03 04 Code:
04 D H - - 03 C G K - 02 B - L - 01 A E I - 01 02 03 04 |
|
||||
|
Hi,
Try this, sed '/^0/s/ / -/g' filename . Hi, Can anybody suggest me how to leave the last line in the substitution. Requirement is to do substitution in all the lines except the last line. I tried sed '!$s/ / -/g' filename ....But its not working ..giving syntax error Thanks Penchal |
|
||||
|
Quote:
The below sed will substitute in all the lines except the last line Code:
sed '$!s/ / -/g;s/^ -/- /g' inpfile Chella |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|