The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
.
google unix.com



UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Parsing records from one record bwrynz1 UNIX for Advanced & Expert Users 1 03-10-2008 10:54 AM
deleting multiple records from a huge file at one time dsravan Shell Programming and Scripting 5 02-06-2008 11:17 AM
Count No of Records in File without counting Header and Trailer Records guiguy Shell Programming and Scripting 2 06-07-2007 12:15 PM
How to extract duplicate records with associated header record run_eim UNIX for Dummies Questions & Answers 17 01-16-2007 11:46 PM
Parsing a variable length record Barb UNIX for Dummies Questions & Answers 17 10-01-2004 08:37 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 03-07-2008
bwrynz1 bwrynz1 is offline
Registered User
  
 

Join Date: Jan 2008
Posts: 6
Parsing out records from one huge record

Hi,

I have one huge record and know that each record in the file is 550 bytes long. How do I parse out individual records from the single huge record.

Thanks,
  #2 (permalink)  
Old 03-07-2008
shamrock shamrock is offline Forum Advisor  
Registered User
  
 

Join Date: Oct 2007
Location: USA
Posts: 750
Quote:
Originally Posted by bwrynz1 View Post
Hi,

I have one huge record and know that each record in the file is 550 bytes long. How do I parse out individual records from the single huge record.

Thanks,
Show how the input (one huge record) and what the output (individual records from the single huge record) looks like.
  #3 (permalink)  
Old 03-07-2008
bwrynz1 bwrynz1 is offline
Registered User
  
 

Join Date: Jan 2008
Posts: 6
The one huge record file is 9 MB long... I'm sorry I can't post it here.

But assume there is a record as follows -
1234567890abcdefghij1234567890abcdefghij1234567890
and I wanted to put a line break after each 10 characters and get the following -
1234567890
abcdefghij
1234567890
abcdefghij
1234567890

Thanks for offering to help
  #4 (permalink)  
Old 03-07-2008
bwrynz1 bwrynz1 is offline
Registered User
  
 

Join Date: Jan 2008
Posts: 6
The one huge record file is 9 MB long... I'm sorry I can't post it here.

But assume there is a record as follows -
1234567890abcdefghij1234567890abcdefghij1234567890
and I wanted to put a line break after each 10 characters and get the following -
1234567890
abcdefghij
1234567890
abcdefghij
1234567890

Thanks for offering to help
  #5 (permalink)  
Old 03-07-2008
jim mcnamara jim mcnamara is offline Forum Staff  
...@...
  
 

Join Date: Feb 2004
Location: NM
Posts: 5,720
No UNIX tool can read a 9MB record. If you look at the man page for dd, you can specify a cbs=10:

Code:
dd cbs=10 conv=unblock < oldfile > newfile
This creates a stream of carriage returns at the end of 10 character records.
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 09:33 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0