Sponsored Content
Full Discussion: files cross over
Top Forums Shell Programming and Scripting files cross over Post 302141080 by drl on Wednesday 17th of October 2007 03:54:47 PM
Old 10-17-2007
Hi.

You can use command paste for this, but you need to tell it to use a newline (\n) rather than a TAB as a separator.

See man paste, experiment, and follow-up if you run into trouble ... cheers, drl
 

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
PASTE(1)						    BSD General Commands Manual 						  PASTE(1)

NAME
paste -- merge corresponding or subsequent lines of files SYNOPSIS
paste [-s] [-d list] file ... DESCRIPTION
The paste utility concatenates the corresponding lines of the given input files, replacing all but the last file's newline characters with a single tab character, and writes the resulting lines to standard output. If end-of-file is reached on an input file while other input files still contain data, the file is treated as if it were an endless source of empty lines. The options are as follows: -d list Use one or more of the provided characters to replace the newline characters instead of the default tab. The characters in list are used circularly, i.e., when list is exhausted the first character from list is reused. This continues until a line from the last input file (in default operation) or the last line in each file (using the -s option) is displayed, at which time paste begins selecting characters from the beginning of list again. The following special characters can also be used in list: newline character tab character \ backslash character Empty string (not a null character). Any other character preceded by a backslash is equivalent to the character itself. -s Concatenate all of the lines of each separate input file in command line order. The newline character of every line except the last line in each input file is replaced with the tab character, unless otherwise specified by the -d option. If '-' is specified for one or more of the input files, the standard input is used; standard input is read one line at a time, circularly, for each instance of '-'. EXIT STATUS
The paste utility exits 0 on success, and >0 if an error occurs. EXAMPLES
List the files in the current directory in three columns: ls | paste - - - Combine pairs of lines from a file into single lines: paste -s -d ' ' myfile Number the lines in a file, similar to nl(1): sed = myfile | paste -s -d ' ' - - Create a colon-separated list of directories named bin, suitable for use in the PATH environment variable: find / -name bin -type d | paste -s -d : - SEE ALSO
cut(1), lam(1) STANDARDS
The paste utility is expected to be IEEE Std 1003.2 (``POSIX.2'') compatible. HISTORY
A paste command appeared in Version 32V AT&T UNIX. BSD
June 25, 2004 BSD
All times are GMT -4. The time now is 01:38 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy