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
Hidden control characters in a Unix Text File! kewl_guy Shell Programming and Scripting 6 09-30-2008 01:09 PM
Control character in a file cursive UNIX for Dummies Questions & Answers 5 04-26-2007 01:40 AM
Control saving file by type saswerks UNIX for Dummies Questions & Answers 4 02-15-2005 04:47 PM
how can I create a dos file in sco unix? fresh SCO 2 03-29-2004 11:09 AM
unix process control nicko Filesystems, Disks and Memory 2 05-16-2002 07:39 AM

 
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
Prev Previous Post   Next Post Next
  #1 (permalink)  
Old 06-05-2006
alfredo123 alfredo123 is offline
Registered User
  
 

Join Date: Jun 2006
Posts: 44
Exclamation create control file in UNIX

UNIX gurus:

Following is what I am trying to do:

I need to create a control file for another file that I am creating. The information needed in the control file is the date in YYYYMMDD format and then the number of records in the other file right justified and lpadded with spaces of 20.

So say I have a file a.dat and it has 200 records.
I need to create a control file a.ctl having the following data.

20060605 200

I can only use UNIX commands as I am not allowed to use any scripts. I know date +'%Y%m%d' will give me the date in YYYYMMDD format and wc -l <filename> would give me record count but how would I go about piping the output of the above to one control file?
 

Bookmarks

Tags
unix commands

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 11:52 AM.


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