Sponsored Content
Full Discussion: files cross over
Top Forums Shell Programming and Scripting files cross over Post 302141231 by radoulov on Thursday 18th of October 2007 07:08:34 AM
Old 10-18-2007
As drl suggested (this is the lazy way, you could make f1,f2 ... dynamic if you wish, and use parameter expansion instead of cut):

Code:
zsh 4.3.4% fgrep . file*
file1:f1 01 1.0
file1:f1 02 2.0
file1:f1 03 3.0
file1:f1 04 4.0
file1:f1 05 5.0
file1:f1 06 6.0
file2:f2 01 21.0
file2:f2 02 22.0
file2:f2 03 23.0
file2:f2 04 24.0
file2:f2 05 25.0
file2:f2 06 26.0
file3:f3 01 31.0
file3:f3 02 32.0
file3:f3 03 33.0
file3:f3 04 34.0
file3:f3 05 35.0
file3:f3 06 36.0
zsh 4.3.4% paste -d"\n" <(printf "f1 %s %s %s\n" $(cut -f3 -d" " file1))\
<(printf "f2 %s %s %s\n" $(cut -f3 -d" " file2))\
<(printf "f3 %s %s %s\n" $(cut -f3 -d" " file3))
f1 1.0 2.0 3.0
f2 21.0 22.0 23.0
f3 31.0 32.0 33.0
f1 4.0 5.0 6.0
f2 24.0 25.0 26.0
f3 34.0 35.0 36.0

 

7 More Discussions You Might Find Interesting

1. Post Here to Contact Site Administrators and Moderators

Cross Posting

In regards to this post: https://www.unix.com/showthread.php?s=&threadid=10372 it may be advisable to inform new members about the repercussions of cross-posting. (9 Replies)
Discussion started by: Karma
9 Replies

2. Shell Programming and Scripting

Cross checking two files

i have two files which contains some fields separated by columns as 03/29/1999 08:48:12 02 172.16.114.50 03/29/1999 09:08:00 480 172.16.112.100 Both of the files do have the same format I want the script which will take two such... (3 Replies)
Discussion started by: vaibhavkorde
3 Replies

3. Shell Programming and Scripting

awk cross-referencing between two files

I need to make my sloppy, existing code (non awk) more efficient and I seem to be terrible with awk :wall: I've tried around quite a bit, maybe you guys can conjure up a quick solution... file1: 2 SOL 563 2 SOL 565 3 SOL 589 2 SOL 603 1 SOL 612 1 SOL 621... (1 Reply)
Discussion started by: origamisven
1 Replies

4. UNIX for Dummies Questions & Answers

Cross complie linux make files onto a windows 7 machine using PGI Cygwin

Hello, I am very unfamiliar with linux/unix (don't even know the difference), but am trying to get some linux software to run on my Windows machine for my research. I have the makefiles for the software, and it is designed to be compiled in the PGI complier, which I also have. When i... (6 Replies)
Discussion started by: roba87
6 Replies

5. Linux

Cross compile

Hi, I'm cross compiling libelektra to arm from linux system its giving library errors can any one help me? (0 Replies)
Discussion started by: Gautham.P
0 Replies

6. Programming

what is a cross compiler

recently i was been to an interview to an automotive company, they have posed me a question that what section of compiler must be changed if the target is changed. ie,if ur compiler is meant for generating executable to a 8051 target what changes do you do to make it flexible to generate the... (2 Replies)
Discussion started by: shyam.sunder91
2 Replies

7. Shell Programming and Scripting

Cross Tab

I need help to do cross tab file input 20160101|ASIA|CHINA|2000 20160101|ASIA|INDIA|3000 20160102|ASIA|CHINA|4000 20160103|ASIA|CHINA|2000 20160103|AFRIKA|ZAMBIA|2000 20160104|ASIA|CHINA|5000 expected output CONTINENT|NATION|20160101|20160102|20160103|20160104... (1 Reply)
Discussion started by: radius
1 Replies
ExtUtils::MM_Any(3pm)					 Perl Programmers Reference Guide				     ExtUtils::MM_Any(3pm)

NAME
ExtUtils::MM_Any - Platform agnostic MM methods SYNOPSIS
FOR INTERNAL USE ONLY! package ExtUtils::MM_SomeOS; # Temporarily, you have to subclass both. Put MM_Any first. require ExtUtils::MM_Any; require ExtUtils::MM_Unix; @ISA = qw(ExtUtils::MM_Any ExtUtils::Unix); DESCRIPTION
FOR INTERNAL USE ONLY! ExtUtils::MM_Any is a superclass for the ExtUtils::MM_* set of modules. It contains methods which are either inherently cross-platform or are written in a cross-platform manner. Subclass off of ExtUtils::MM_Any and ExtUtils::MM_Unix. This is a temporary solution. THIS MAY BE TEMPORARY! Inherently Cross-Platform Methods These are methods which are by their nature cross-platform and should always be cross-platform. File::Spec wrappers DEPRECATED The following methods are deprecated wrappers around File::Spec functions. They exist from before File::Spec did and in fact are from which File::Spec sprang. They are all deprecated. Please use File::Spec directly. canonpath catdir catfile curdir file_name_is_absolute path rootdir updir Thought To Be Cross-Platform Methods These are methods which are thought to be cross-platform by virtue of having been written in a way to avoid incompatibilities. test_via_harness my $command = $mm->test_via_harness($perl, $tests); Returns a $command line which runs the given set of $tests with Test::Harness and the given $perl. Used on the t/*.t files. test_via_script my $command = $mm->test_via_script($perl, $script); Returns a $command line which just runs a single test without Test::Harness. No checks are done on the results, they're just printed. Used for test.pl, since they don't always follow Test::Harness formatting. AUTHOR
Michael G Schwern <schwern@pobox.com> with code from ExtUtils::MM_Unix and ExtUtils::MM_Win32. perl v5.8.0 2002-06-01 ExtUtils::MM_Any(3pm)
All times are GMT -4. The time now is 12:54 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy