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 and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
alternative for head command nikhilneela UNIX for Dummies Questions & Answers 2 02-19-2009 08:39 AM
head command wont work on MF file alfredo123 UNIX for Dummies Questions & Answers 10 03-04-2007 10:23 AM
head command sumesh.abraham Shell Programming and Scripting 6 02-23-2007 10:21 AM
Simple Command (head) Question jbud UNIX for Dummies Questions & Answers 4 04-23-2006 10:16 PM

 
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-09-2009
josegr josegr is offline
Registered User
  
 

Join Date: Apr 2009
Posts: 20
head command with more than one file

Hi, I have the following problem. I have files with one column of data (let's say file1.dat, file2.dat...file6.dat), and I would like to record the first value of the column of each file into another file (let's name it fileall.dat), which would have the the six values, one in each column. I use to do it as follows,

head --lines=1 file_i.dat >> record_i.dat

with i={1,...,6}, and then, I pasted all with

paste -d" " record_1.dat record_2.dat ... record_6.dat > fileall.dat

and then I had the 6 first values of each data file column together in one file. Is there any way to do it all in one step?
 

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 08:10 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