![]() |
|
|
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 |
| seeking help in text processing | Alecs | Shell Programming and Scripting | 8 | 04-22-2008 02:17 PM |
| Simple Event Processing != Complex Event Processing | iBot | Complex Event Processing RSS News | 0 | 12-16-2007 12:10 PM |
| text file processing | alias47 | UNIX for Dummies Questions & Answers | 1 | 08-09-2007 12:10 PM |
| Processing a text file | TheCrunge | UNIX for Dummies Questions & Answers | 1 | 11-09-2005 11:47 AM |
| grep multiple text files in folder into 1 text file? | coppertone | UNIX for Dummies Questions & Answers | 7 | 08-23-2002 03:50 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
hi vino...
its not working.. its showing me the same output... i tested in a small file having abcdefghijklmopqrstuvwxyz in a line.... so after -e "s/.\{4\}/&\n/g" file.txt the output should be abcd efgh ijkl lmno ... ... but its unchaged.. pl help |
|
||||
|
script
total_chars=`wc -c filename | cut -c 1-8 ` block_size=400 cut_from=1 cut_to=400 total_chars=`expr $total_chars + 0` #The above step is to get total_chars treated as number for below comparison while [ $cut_from -le $total_chars ] do cut -c `echo $cut_from`-`echo $cut_to` filename >> outfile cut_from=`expr $cut_from + $block_size` cut_to=`expr $cut_to + $block_size` done |
|
||||
|
Thanks Franklin52,
![]() hi anchal_khare, u can also check the below code awk '{n=1;while( n<=length($0)) { t = substr($0,n,4); print t"\n"; n= n+4} }' Filename Input: abcdefghijklmnopqrstuvwxyz output abcd efgh ijkl mnop qrst uvwx yz |
![]() |
| Bookmarks |
| Tags |
| linux, solaris |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|