Sponsored Content
Top Forums UNIX for Beginners Questions & Answers How to copy a column of multiple files and paste into new excel file (next to column)? Post 303034000 by dineshkumarsrk on Tuesday 16th of April 2019 09:52:16 AM
Old 04-16-2019
I have been using your script without any issue, until I had a data set with different row numbers (I mentioned above). So far, I had processed more than 5 groups of data sets (in each group I had 30 excel files), where in I did not face this kind of problem. Moreover, even I do not expect that, I would face this kind of issue. I thought, my data files have the same number of rows and columns. But, while processing multiple data files, I came to know that it differs. This is why I could not mention it earlier.
Code:
 Given this new information that files 6 to 10 (is it always 6 to 10, or s 6 to 10 just as an example;

It is an example only. My data set would not be same as I mentioned above. In some cases, each file differ in terms of row number (number of rows are not same for all the files). Whereas, the number of columns are same for all the files.

Code:
is it org6.xls through org10.xls inclusive or does org10.xls go back to three lines) may have different numbers of lines than other files with no prior knowledge about which files are "short" or "long", how would you propose modifying any of the scripts suggested in post #22 to get the output you want based on this new information?

I need to copy only the field/column number 1 and 5 regardless of the number of rows each file have. It would be tedious to know which file is short and which file is long when I have 50 or 60 excel files.
If it a prerequisite to know, which file is short and which file is long to write a script for the same, I would not have asked for help.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

paste each 10 lines of single column to several column

Hi, I need to paste each 10 lines of single column to several columns. Please, can anyone tell me how to write in awk? Input File: 22 34 36 12 17 19 15 11 89 99 56 38 29 (4 Replies)
Discussion started by: nica
4 Replies

2. Shell Programming and Scripting

Copy a column and paste to other file question

Please help me. This is simple, but urgent problem for me. :( I have a two files file1 1 2 3 4 5 6 1 2 3 4 5 6 1 2 3 4 5 6 ..... file2 11 12 13 14 15 11 12 13 14 15 11 12 13 14 15 ..... 1) I hope to make a new file, file 3, that consists of 2nd... (2 Replies)
Discussion started by: exsonic
2 Replies

3. UNIX for Advanced & Expert Users

Copy a column to another column in UNIX fixedwidth file

Hi All, I have a fixedwidth file of length 3000. Now i want to copy a column of 4 chars i.e( length 1678-1681) to column 1127 – 1171 to the same file. Please let me know how can i achive using a single command in fixed width file. Also source column length is 4 chars and target column length... (4 Replies)
Discussion started by: kiranparsha
4 Replies

4. UNIX for Dummies Questions & Answers

Paste column from one file as column of

Any shortcuts for doing this? I need to cut the column 4 values from File1 and paste them as column4 values of File2, but only for the (first) same number of lines as File1 . All rows in File1 are contained in File2 in the exact same order, so the cut paste should work. File1 (with header and 3... (4 Replies)
Discussion started by: senhia83
4 Replies

5. Shell Programming and Scripting

Problems with awk (fatal error) and paste (two variables into one column-by-column)

Hello, I have a script extracting columns of useful numbers from a data file, and manipulating the numbers with awk commands. I have problems with my script... 1. There are two lines assigning numbers to $BaseForAveraging. If I use the commented line (the first one) and let the second one... (9 Replies)
Discussion started by: vgbraymond
9 Replies

6. Shell Programming and Scripting

Paste columns based on common column: multiple files

Hi all, I've multiple files. In this case 5. Space separated columns. Each file has 12 columns. Each file has 300-400K lines. I want to get the output such that if a value in column 2 is present in all the files then get all the columns of that value and print it side by side. Desired output... (15 Replies)
Discussion started by: genome
15 Replies

7. Shell Programming and Scripting

Locate the files in the first column and copy the files in 2nd column

#cat data.txt file1 folder1 file2 thisforfile2 file3 thisfolderforfile3 lata4 folder4 step 1: create the folder first in column 2 for i in `awk '{print $2}' data.txt` do mkdir /home/data/$i done step 2: locate the files in column1 and stored them into a file for i in... (17 Replies)
Discussion started by: kenshinhimura
17 Replies

8. UNIX for Beginners Questions & Answers

How to insert data into black column( Secound Column ) in excel (.XLSX) file using shell script?

Source Code of the original script is down below please run the script and try to solve this problem this is my data and I want it column wise 2019-03-20 13:00:00:000 2019-03-20 15:00:00:000 1 Operating System LAB 0 1 1 1 1 1 1 1 1 1 0 1 (5 Replies)
Discussion started by: Shubham1182
5 Replies

9. UNIX for Beginners Questions & Answers

How to copy particular files from a multiple directories and paste in a new directory?

Dear all I have a multiple directories, say for example org1, org2, org3 ..... org100 and each directory having a file namely dnaG.fasta. I need to copy all the dnaG.fasta file from each directory and paste in another directory fastconcatg. Therefore, my script has to copy dnaG.fasta file from... (5 Replies)
Discussion started by: dineshkumarsrk
5 Replies

10. UNIX for Beginners Questions & Answers

Copy files if column 5 in a file contains ā€œVā€

I have number of csv files (like tmo_2019*). In these files some files have 5th column value as V. I want to copy those files having 5th column value as V to specific directory /test/V_files/. I tried to extract file names by below but not able to complete command for copy. find -type f -iname... (4 Replies)
Discussion started by: Bops
4 Replies
COMPFACE(1)						      General Commands Manual						       COMPFACE(1)

NAME
compface, uncompface - compress and expand 48x48x1 face image files SYNOPSIS
compface [ infile [ outfile ] ] ... uncompface [-X] [ infile [ outfile ] ] ... DESCRIPTION
compface is a filter for generating highly compressed representations of 48x48x1 face image files. uncompface is an inverse filter which performs an inverse transformation with no loss of data. The algorithm used is highly tuned for its purpose and achieves better than a five to one compression ratio on average. Arguments operate identically for both programmes. The first argument, if present, causes input to be taken from the named file instead of from standard input unless it is the string ``-''. A second argument, if present, causes output to go to the named file instead of to standard output unless it is the string ``-''. Subsequent pairs of arguments may be used to specify further pairs of input and output files. The input format for compface (and the output format for uncompface) is 48 lines each of 3 sixteen bit hexadecimal integers, comma termi- nated in C initialiser style. The output format of compface (and the input format for uncompface) is some number of lines made up of a space followed by printable characters (in the range ``!'' to ``~'' inclusive). The first line contains 72 characters and following lines contain 79 characters except that the last line may be short. This version of compface has been patched to also be able to handle normal XBM images. uncompface will produce XBM output only if the -X switch is applied. The amount of compression obtained varies between face image files but the output of compface averages less than 200 characters. The aver- age number of output lines is three. DIAGNOSTICS
Exit status is normally 0. Possible errors include IO errors when opening, reading or writing files, format errors in compface input files and invalid arguments. Each results in an explanatory message on standard error and an exit status of 1. A warning will be produced if compface detects extra input data. BUGS
Nominating standard input as input more than once does not work. SEE ALSO
Compface(3) 25 January 1990 COMPFACE(1)
All times are GMT -4. The time now is 06:02 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy