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
Formatting mirusnet Shell Programming and Scripting 3 01-06-2008 08:38 PM
Formatting a report from 2 files augustinep Shell Programming and Scripting 12 12-19-2006 11:54 AM
Formatting using awk cdunavent Shell Programming and Scripting 2 03-18-2003 11:09 AM
formatting tamemi UNIX for Dummies Questions & Answers 5 07-21-2002 06:03 AM
formatting xeron UNIX for Dummies Questions & Answers 5 03-20-2002 08:33 AM

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 03-20-2002
Registered User
 

Join Date: Mar 2002
Location: CT
Posts: 1
Formatting files

We currently use the following script to format a non formatted file to an 80 byte format (for grep purposes etc..) We need some assistance with converting the file back to a non formatted file with no carriage returns ( we want the file to be a continuous line)

#!/usr/local/bin/perl

($fn, $len) = @ARGV;

open(IFN, "<$fn") || die "Fail to open $fn\n";
#open(OFN, ">$fn.$len") || die "Fail to open $fn.$len\n";
open(OFN, ">$fn.dat") || die "Fail to open $fn.$len\n";

while (sysread(IFN, $line, $len)) {
print OFN "$line\n";
}
close(IFN);
close(OFN);


Thanks in advance for your assistance
Reply With Quote
Forum Sponsor
  #2  
Old 03-21-2002
PxT's Avatar
PxT PxT is offline
Registered User
 

Join Date: Oct 2000
Location: Sacramento, CA
Posts: 909
To remove all line breaks:

tr -d '\n' < inputfile
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 06:54 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