![]() |
|
|
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 |
| cut first 4 characters from a line | kaushikraman | UNIX for Dummies Questions & Answers | 5 | 07-22-2008 06:19 AM |
| sed remove last 10 characters of a line start from 3rd line | minifish | Shell Programming and Scripting | 7 | 03-26-2008 04:42 PM |
| use of hyphen in #! line | Dhruva | Shell Programming and Scripting | 7 | 04-16-2007 01:28 AM |
| Max no. of characters in a line | pankschawla | UNIX for Advanced & Expert Users | 4 | 04-02-2004 12:04 PM |
| awk and getting # of characters in a line | smacleod | UNIX for Dummies Questions & Answers | 1 | 04-15-2002 02:57 PM |
|
|
LinkBack | Thread Tools | Search this Thread |
Rating:
|
Display Modes |
|
||||
|
add a hyphen every 2 characters of every line
I have a text file like this with hundreds of lines:
>cat file1.txt 1027123000 1027124000 1127125000 1128140000 1228143000 > all lines are very similar and have exactly 10 digits. I want to separate the digits by twodigit and hyphens....like so, > 10-27-12-30-00 10-27-12-40-00 11-27-12-50-00 11-28-14-00-00 12-28-14-30-00 > I just did some searching on this forum and it looks like I'll need a command that takes on this form: sed "s/\([0-9]\......" I need the exact notation though? |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|