Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Combining files from different directories Post 302698565 by A-V on Monday 10th of September 2012 09:15:26 AM
Old 09-10-2012
worked like magic but now I realized I have another problem and that is
file01 has more than 1 line but paste combines the first line of each

how can do it in a way that it will read each line and combine them? is there a way to do it?
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Combining Two Files

I have two files which contain data from two different transactions in the same format: <Name> - <Count> My goal is to end up with data in this format after combining the two: <Name> - <Count1> - <Count2> Is this possible to do with awk, or is there something better? Thanks... (3 Replies)
Discussion started by: bat711
3 Replies

2. Shell Programming and Scripting

Combining Two Files

Could someone help me reduce the number of runs for a shell program I created? I have two text files below: $ more list1.txt 01 AAA 02 BBB 03 CCC 04 DDD $ more list2.txt 01 EEE 02 FFF 03 GGG I want to combine the lines with the same number to get the below: 01 AAA 01 EEE 02... (4 Replies)
Discussion started by: stevefox
4 Replies

3. UNIX for Dummies Questions & Answers

combining two files

Hi Gurus, I have 2 files: File1 Filename1 xx Filename1 yy Filename1 Total Filename2 xx Filename2 yy Filename2 zz Filename2 Total Filename3 xx Filename3 Total and File2: Filename1 10296 xxx Date: 09/01/08 Filename2 10296 xxx Date: 09/05/08... (36 Replies)
Discussion started by: rock1
36 Replies

4. UNIX for Dummies Questions & Answers

List directories and sub directories recursively excluding files

Hi, Please help me, how to get all the direcotries, its sub directories and its sub directories recursively, need to exclude all the files in the process. I wanted to disply using a unix command all the directories recursively excluding files. I tried 'ls -FR' but that display files as... (3 Replies)
Discussion started by: pointers
3 Replies

5. UNIX for Dummies Questions & Answers

Need Help in reading N days files from a Directory & combining the files

Hi All, Request your expertise in tackling one requirement in my project,(i dont have much expertise in Shell Scripting). The requirement is as below, 1) We store the last run date of a process in a file. When the batch run the next time, it should read this file, get the last run date from... (1 Reply)
Discussion started by: dsfreddie
1 Replies

6. Shell Programming and Scripting

Combining 2 files

i am having 2 files like this file 1 1, 2, 3, 4, file2 5, 6, 7, 8, what i want do is like this i want to put all the contents for file 2 after file 1,means adding column in file1 (5 Replies)
Discussion started by: sagar_1986
5 Replies

7. Shell Programming and Scripting

Combining files

Hi I have about 108 files (text files) that end with .avg and each one of these files have a distinct name that describes what is in the file. In each file there is a set of 80 values that are tab separated. I want to combine all 108 files into ONE main file. So each file is named: 1.avg... (5 Replies)
Discussion started by: phil_heath
5 Replies

8. Shell Programming and Scripting

How to list all the files, directories and sub-directories in the current path except one directory?

Can anyone come up with a unix command that lists all the files, directories and sub-directories in the current directory except a folder called log.? Thank you in advance. (7 Replies)
Discussion started by: Manjunath B
7 Replies

9. Shell Programming and Scripting

Archiving and moving files into directories, creating directories, etc.

how can i move "dataName".sql.gz into a folder called 'database' and then move "$fileName".tar.gz * .htaccess into a folder called 'www' with the entire gzipped file being "$fileName".tar.gz? Is this doable or overly complex. so mydemo--2015-03-23-1500.tar.gz > database -... (5 Replies)
Discussion started by: wyclef
5 Replies
paste(1)							   User Commands							  paste(1)

NAME
paste - merge corresponding or subsequent lines of files SYNOPSIS
paste [-s] [-d list] file... DESCRIPTION
The paste utility will concatenate the corresponding lines of the given input files, and write the resulting lines to standard output. The default operation of paste will concatenate the corresponding lines of the input files. The NEWLINE character of every line except the line from the last input file will be replaced with a TAB character. If an EOF (end-of-file) condition is detected on one or more input files, but not all input files, paste will behave as though empty lines were read from the files on which EOF was detected, unless the -s option is specified. OPTIONS
The following options are supported: -d list Unless a backslash character () appears in list, each character in list is an element specifying a delimiter character. If a backslash character appears in list, the backslash character and one or more characters following it are an element specifying a delimiter character as described below. These elements specify one or more delimiters to use, instead of the default TAB character, to replace the NEWLINE character of the input lines. The elements in list are used circularly. That is, when the list is exhausted, the first element from the list is reused. When the -s option is specified: o The last newline character in a file will not be modified. o The delimiter will be reset to the first element of list after each file operand is processed. When the option is not specified: o The NEWLINE characters in the file specified by the last file will not be modified. o The delimiter will be reset to the first element of list each time a line is processed from each file. If a backslash character appears in list, it and the character following it will be used to represent the following delimiter characters: Newline character. Tab character. \ Backslash character. Empty string (not a null character). If is immediately followed by the character x, the character X, or any charac- ter defined by the LC_CTYPE digit keyword, the results are unspecified. If any other characters follow the backslash, the results are unspecified. -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 will be replaced with the TAB character, unless otherwise specified by the -d option. OPERANDS
The following operand is supported: file A path name of an input file. If - is specified for one or more of the files, the standard input will be used. The standard input will be read one line at a time, circularly, for each instance of -. Implementations support pasting of at least 12 file operands. USAGE
See largefile(5) for the description of the behavior of paste when encountering files greater than or equal to 2 Gbyte ( 2^31 bytes). EXAMPLES
Example 1 Listing a directory in one column example% ls | paste -d" " - Example 2 Listing a directory in four columns example% ls | paste - - - - Example 3 Combining pairs of lines from a file into single lines example% paste -s -d" t n" file ENVIRONMENT VARIABLES
See environ(5) for descriptions of the following environment variables that affect the execution of paste: LANG, LC_ALL, LC_CTYPE, LC_MES- SAGES, and NLSPATH. EXIT STATUS
The following exit values are returned: 0 Successful completion. >0 An error occurred. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWesu | +-----------------------------+-----------------------------+ |CSI |Enabled | +-----------------------------+-----------------------------+ |Interface Stability |Standard | +-----------------------------+-----------------------------+ SEE ALSO
cut(1), grep(1), pr(1), attributes(5), environ(5), largefile(5), standards(5) DIAGNOSTICS
"line too long" Output lines are restricted to 511 characters. "too many files" Except for -s option, no more than 12 input files may be specified. "no delimiters" The -d option was specified with an empty list. "cannot open file" The specified file cannot be opened. SunOS 5.11 20 Dec 1996 paste(1)
All times are GMT -4. The time now is 03:19 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy