The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
Google UNIX.COM


Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
how to read record by record from a file in unix raoscb UNIX for Dummies Questions & Answers 1 05-16-2008 03:30 AM
Splitting a file based on record sin another file er_ashu UNIX for Dummies Questions & Answers 7 05-15-2008 08:06 PM
Adding spaces to record nvenkat010 Shell Programming and Scripting 3 01-28-2008 09:24 AM
Script to search a bad record in a file then put the record in the bad file shilendrajadon Shell Programming and Scripting 2 12-28-2007 06:02 AM
Script to search a bad record in a file then put the record in the bad file shilendrajadon UNIX for Advanced & Expert Users 1 12-28-2007 06:00 AM

Reply
 
Submit Tools LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 08-13-2007
Registered User
 

Join Date: Aug 2007
Posts: 1
Stumble this Post!
Exclamation splitting a record and adding a record to a file

Hi,

I am new to UNIX scripting and woiuld appreicate your help...

Input file contains only one (but long) record:

aaaaabbbbbcccccddddd.....

Desired file:

NEW RECORD #new record (hardcoded) added as first record - its length is irrelevant#
aaaaa
bbbbb
ccccc
ddddd
...
...

a,b,c,d.... could be anything, including spaces.

I 'feel' awk should be the best tool, but my lack of knowledge...

thank you very much.
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 08-13-2007
vgersh99's Avatar
Moderator
 

Join Date: Feb 2005
Location: Boston, MA
Posts: 3,002
Stumble this Post!
to start with....
Code:
echo 'aaaaabbbbbcccccddddd.....' | fold -w5
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 12:11 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008 The CEP Blog All Rights Reserved -Ad Management by RedTyger Visit The Global Fact Book

Content Relevant URLs by vBSEO 3.2.0