The UNIX and Linux Forums  

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
modifying grep to get files only within last 2 hrs ragha81 Shell Programming and Scripting 3 01-11-2007 04:11 PM
modifying grep to return latest files ragha81 Shell Programming and Scripting 4 12-28-2006 01:09 PM
modifying C file and linking back to project files bruins2005 UNIX for Dummies Questions & Answers 1 06-22-2006 08:08 PM
Perl - Appending/Modifying Excel files srinivay Shell Programming and Scripting 2 01-10-2005 03:46 AM
text files, ASCII files, binary files and ftp transfers Perderabo Answers to Frequently Asked Questions 0 04-08-2004 01:25 PM

Closed Thread
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 07-19-2001
Registered User
 

Join Date: Jul 2001
Posts: 1
Question How can I ... (Modifying large ASCII files)

Hi Everybody!

Situation:
I have a large ASCII file (for example: 1-2 Mbytes) without linebreaks (\n).

Task:
I like inserting linebreaks after all 420 digits (byte).
(pattern: *[420pcs]\n*[420pcs]\n*[420pcs]\n...etc.)

My problem:
How? :-)
I like using shell script or (maybe) AWK (short) program.

Please, help me.

Bye
hviktor
Forum Sponsor
  #2  
Old 07-19-2001
Registered User
 

Join Date: Jul 2001
Posts: 9
I dont think you will find a way to do that with a shell script. The only command that I know of would be csplit in a CShell script. this command only allow as maximum of 100 characters to be read at a time. I would suggest you look at a small C program to read the file character by character using a for loop.
  #3  
Old 07-20-2001
flim flam flamma jamma
 

Join Date: May 2001
Location: Chicago IL, USA
Posts: 1,006
Code:
cat $file|sed ' s/420pcs/420pcs\
/gw newfile'
try that
Google The UNIX and Linux Forums
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 02:56 AM.


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

Content Relevant URLs by vBSEO 3.2.0