# pattern changing

**URL:** <https://community.unix.com/t/pattern-changing/227681>\
**Category:** Shell Programming and Scripting\
**Created:** [January 14, 2009, 11:21am UTC](https://community.unix.com/t/pattern-changing/227681 "2009-01-14T11:21:49Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![kripssmart](https://community.unix.com/letter_avatar/kripssmart/32/5_5575768a8748004e209b776fc1b2916d.png) [@kripssmart](https://community.unix.com/u/kripssmart)\
**Post date:** [January 14, 2009, 11:21am UTC](https://community.unix.com/t/pattern-changing/227681/1 "2009-01-14T11:21:49Z")

</div>

Hi,

I have a file with contents in this format....

01234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890...

How can I make it to this format...

0123456789  
0123456789  
0123456789  
0123456789  
0123456789  
0123456789  
0123456789  
0123456789  
.  
.  
.

Is there any command that can help me acheive this quickly..

I have just quoted like '0123456789'.. I just put it up like that... Its not in a seriel fashion... But the length of each record after formatting should is fixed say 30....

Thanks for all your help!

---

<div class="post-metadata">

**Author:** ![kripssmart](https://community.unix.com/letter_avatar/kripssmart/32/5_5575768a8748004e209b776fc1b2916d.png) [@kripssmart](https://community.unix.com/u/kripssmart)\
**Post date:** [January 14, 2009, 11:23am UTC](https://community.unix.com/t/pattern-changing/227681/2 "2009-01-14T11:23:49Z")

</div>

I have just quoted like '0123456789'.. I just put it up like that... Its not in a seriel fashion... But the length of each record is fixed say 30....

Thanks!

---

<div class="post-metadata">

**Author:** ![rubin](https://community.unix.com/user_avatar/community.unix.com/rubin/32/743_2.png) [@rubin](https://community.unix.com/u/rubin)\
**Post date:** [January 14, 2009, 11:40am UTC](https://community.unix.com/t/pattern-changing/227681/3 "2009-01-14T11:40:49Z")

</div>

Take a look at the fold command:

```nohighlight
fold -w 30 file

```

[if I correctly understood your requirement]

---

<div class="post-metadata">

**Author:** ![kripssmart](https://community.unix.com/letter_avatar/kripssmart/32/5_5575768a8748004e209b776fc1b2916d.png) [@kripssmart](https://community.unix.com/u/kripssmart)\
**Post date:** [January 16, 2009, 5:58am UTC](https://community.unix.com/t/pattern-changing/227681/4 "2009-01-16T05:58:16Z")

</div>

Yep PERFECT!!!  
Thanks Rubin...
