![]() |
|
|
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 |
| Search a string and append text after the string | kesu2k | Shell Programming and Scripting | 8 | 07-18-2008 08:35 PM |
| Sed append newline character | Gaurang033 | Shell Programming and Scripting | 3 | 06-26-2008 06:57 AM |
| append a character at end of each line of a file | muaz | Shell Programming and Scripting | 4 | 06-25-2008 08:48 AM |
| append character to a file | enuenu | High Level Programming | 3 | 06-11-2007 05:59 AM |
| Using SED to append character to each line | c0nn0r | Shell Programming and Scripting | 4 | 07-08-2006 10:07 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
How do I append a ^M to the end of each 129 character string
Hello all,
I have a stumper of a problem. I am trying to append a ^M or "newline" to the end of each 129 character string in a huge file in unix. Each string starts with A00. I am trying to get the file to go from... A00vswjdv1 Test Junk Junk A00vswjdv2 Test Junk Junk A00vswjdv3 Test Junk Junk to look like.... A00vswjdv1 Test Junk Junk A00vswjdv2 Test Junk Junk A00vswjdv3 Test Junk Junk Any help is greatly appreciated. BTW. I am on a AIX box. |
|
||||
|
Thank you. I will try it now and post again if it works.
-----Post Update----- Command finished but I now find the strings do not all start with A00. They range from A00-A55. The command did work for the A00 ones. What a mess! Last edited by Captain; 06-11-2009 at 04:05 PM.. |
|
|||||
|
Quote:
Code:
awk 'gsub("A[0-5][0-5]", "\n&", $0)' myFile
|
![]() |
| Bookmarks |
| Tags |
| append, newline after number of characters |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|