Hello I'm looking to take one file that has multiple lines and columns and add (sum) the values horizontally of columns with repeated headers. In my file, I'm ignoring the first 9 columns and the first row because I want them to be printed in the outcome, untouched. (the columns are not in a repeating order and there are many more columns than the example). The idea is something like this:
Hello everybody,
I have a text file containing 10,000 rows and 5000 columns. The values are separated by a tab.
Ex.
file_ex.ped
1 mike 0 0 2 1 A A G G C T A G
1 jack 0 0 2 2 T A G T C A A C
1 Mary 0 0 1 2 A T G C A T G C
...
I would like a out put file
1 mike 0 0 2 1 AA GG CT AG
1... (7 Replies)
Hi Guys,
I want to combine 2 files and and put together in 1 file and make two columns out it. See below desired output. Any help will be much appreciated.
inputfile1.txt
12345
67890
24580
inputfile2.txt
AAAAA
BBBBB
CCCCC (11 Replies)
This may seem obvious but I am having problems doing this as columns get converted to rows when i try to write a script.
I have 2 files text1.txt and text2.txt each of which have 6 columns of numbers separated by a space.
I need to combine the 2 files so that the output file text3.txt maintains... (2 Replies)
Hi, Great minds, I have some files, in fact header files, of CTD profiler, I tried a lot C programming, could not get output as I was expected, because my programming skills are very poor, finally, joined unix forum with the hope that, I may get what I want, from you people,
Here I have attached... (17 Replies)
Hello everyone,
I searched the forum looking for answers to this but I could not pinpoint exactly what I need as I keep having trouble.
I have many files each having two columns and hundreds of rows.
first column is a string (can have many words) and the second column is a number.The files are... (5 Replies)
Hello,
I have some tab delimited text files with a three header rows. The headers look like, (sorry the tabs look so messy).
index group Name input input input input input input input input input input input... (9 Replies)
Need some help with this ... please
60644,NJ090237_0263_GRP,NJ090237_0263_VIEW,NJ090237_0263_PSGRP,NJ090237_0263_GOLD_CSGRP,,06E:0_08E:0_09E:0_11E:0,0CE5,TDEV,34,VP_TIER... (3 Replies)
Hello,
I have to fish out some specific columns from a file based on the header value. I have the list of columns I need in a different file. I thought I could read in the list of headers I need,
# file with header names of required columns in required order
headers_file=$2
# read contents... (11 Replies)
Hi All,
i am trying to print required multiple columns dynamically from a fie.
But i am able to print only one column at a time.
i am new to shell script, please help me on this issue.
i am using below script
awk -v COLT=$1 '
NR==1 {
for (i=1; i<=NF; i++) {
... (2 Replies)
Discussion started by: balu1234
2 Replies
LEARN ABOUT DEBIAN
getcol
getcol(1) General Commands Manual getcol(1)Name
getcol - Extract specified columns from an ASCII table file
Synopsis
getcol [-amv][-n num][-r lines][-s num] filename [column number range]
Description
Extract specified columns from an ASCII table file
Options
filename
Name of a ASCII table file. At least one of these must be present for any values to be printed. If it is stdin or STDIN, an ASCII
table is expected as standard input. If there is no input file, standard input is assumed.
@filename
Name of a file containing a list of ASCII table files. If this is present, any other file names on the command line will be
ignored.
field range
Print value of these columns for the number of lines of the table specified by the -n argument after the skippiing the number of
lines specified by the -s argument. A value of 0 causes the entire input line to be printed.
-a Sum all numeric columns selected, printing the sum on the line following the result. Columns with no sum are filled with ___.
(Added in version 2.6.9)
-b Input is bar-separate table file
-c Add count of number of lines in each column at end
-d <number>
Number of decimal places in f.p. output
-e Compute medians of selected columns
-f Print range of values in selected columns
-h Print Starbase tab table header
-i Input is tab-separate table file
-k Print number of columns on first line
-l <number>
Number of lines to add to each line
-m Compute the means of all numeric columns selected, printing the mean on the line following the result (or the line following the sum
if -a is used). Columns with no mean are filled with ___. (Added in version 2.6.9)
-n num Print selected columns for this many lines. If not specified, all lines will be read after the number of lines specified by -s have
been skipped.
-o OR conditions insted of ANDing them
-p Print only sum, mmean, sigma, median, or range, not entries
-r @listfile
-r line range Print columns from the lines specified as either the first nonzero number on each line of the file listfile or the
comma- and hyphen- delimitied range; i.e. 1-5,10-12 will print values from lines 1, 2, 3, 4, 5, 10, 11, and 12. (added in version
2.6.12)
-s num Skip this many line before starting to print values. If not specified, no lines will be skipped.
-t Starbase (tab-separated) table output
-v Print more information about process.
Web Page
http://tdc-www.harvard.edu/software/wcstools/getcol.html
Author
Doug Mink, SAO (dmink@cfa.harvard.edu)
8 November 2001 WCSTools getcol(1)