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 > 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
contactenate columns from multiple files coolnaps Shell Programming and Scripting 2 05-03-2008 07:01 PM
merging multiple log files jack1981 Shell Programming and Scripting 3 10-03-2006 09:50 AM
Compare multiple columns between 2 files stevesmith Shell Programming and Scripting 15 09-20-2006 01:04 PM
Extracting columns from different files for later merging kingkong UNIX for Dummies Questions & Answers 2 11-23-2005 03:21 AM
merging few columns of two text files to a new file kolvi Shell Programming and Scripting 4 09-15-2005 05:34 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 08-02-2008
isgoed isgoed is offline
Registered User
  
 

Join Date: Aug 2008
Location: the universe
Posts: 1
Merging columns from multiple files in one file

Hi,

I want to select columns from multiple files and combine them in one file. The files are simulation-data-files with 23 columns each and about 50 rows. I now use:

Code:
cut -f 11 Sweep?wing-30?scale=0.?0?fan2?.txt | pr -3 | awk '{printf("\n%s\t%s\t%s",$1,$2,$3)}' > ../Data_Processed/output.txt
I cut the 11th column out of files called
Sweep|wing-30|scale=0.30|fan2|.txt
Sweep|wing-30|scale=0.50|fan2|.txt
Sweep|wing-30|scale=0.70|fan2|.txt,
put them in 3 columns with pr -3 (instead of having all the columns joined underneath each other) and than use awk again to make the formatting tab-delimited.

It seems to me that there might be an easier solution to merge these files. One that only uses awk and getline maybe? And automatically format and for variable number of input files?

regards.
 

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:01 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