The tag has no usage guidance.

learn more… | top users | synonyms

1
vote
2answers
48 views

awk is putting last column in a new line

I have this -77.199997 23.6343749630 39.9989584580 -80.000000 23.6364583430 39.9989584580 -81.599998 23.6385417220 39.9989584580 I want to reorder the columns so it reads column 2, ...
2
votes
2answers
44 views

Issue with column command and color escape codes

I'm colorizing the header of a table formatted with column -ts $'\t' Works well without color codes, but when I add color codes to the first line column doesn't properly align the output. Without ...
1
vote
1answer
27 views

Matching 2 main columns between files; and paste other columns into the output file when those main columns match. Keep row size of 1st file intact

This is a follow-up question to my previous question asked about 24 hours ago. Link to previous question: Previous Question Link G-Man solved that problem with a useful code, but I have a follow-up ...
0
votes
1answer
15 views

Sum values from column 1 if column 2 rows have a value match

I have data in a .txt like this: 2 40 1 50 1 50 1 50 1 50 2 70 2 70 5 80 5 80 6 100 And I want to sum first column if the second column's rows match so I can get an output like ...
2
votes
1answer
69 views

Matching two main columns at the same time between files, and paste supplementary columns into the output file when those main columns match

I have 3 files, each with a unique number of columns, all tab-separated, but some columns are shared between the 3 files. It's the shared columns between the 3 files that I want to use to create some ...
1
vote
3answers
43 views

combine selected column multi file

I have multiple files (~15), each with multi column data (tab seperated). For example: File1 aa1 399 1815 aa2 1908 4064 aa3 4523 5656 File2 bb1 5304317 5305057 bb2 ...
0
votes
1answer
14 views

Merge records depending on first three common columns and place the values which are uncommon in the last column as comma separated [duplicate]

Merge records depending on first three common columns and place the values which are uncommon in the last column as comma separated . I have a requirement to do the following- InputFile : HWF ...
1
vote
1answer
46 views

Merge records depending on common columns and specify the values which are uncommon in the last column as comma separated

I need to merge records depending on first three common columns and place the values which are uncommon in the last column as comma separated . I have a requirement to do the following- InputFile : ...
1
vote
1answer
47 views

Comapring columns in 2 files and printing the values that differ

I have a file (file-1) that looks like this, DIP-10097N|refseq:NP_416170|uniprotkb:P30015 DIP-10117N|refseq:NP_414973|uniprotkb:P08177 DIP-10168N|refseq:NP_418766|uniprotkb:P15005 ...
2
votes
3answers
83 views

Replace a column and preserve spacing

This is a follow up to unix: replace one entire column in one file with a single value from another file I am trying to replace one column of a file (file1) with one specific value from another file ...
1
vote
5answers
41 views

split the content of a specific column

I need to split the content of the second column of my file into 2 columns, for example: Id allele id2 30 TC 12 211 GG 12 327 AA 13 688 TC 15 760 TT 18 868 CC ...
3
votes
3answers
85 views

How do I create uniform columns from text containing both tabs and spaces?

In the simplest form, let's say I have an auto-generated file called file.txt. The contents of file.txt appears as follows: Source Destination Maximum To Maximum ...
6
votes
4answers
250 views

Delete column that includes a specific text

I was looking for an option to delete a column with a specific text like "ddd" aaa bbb ccc ddd eee fff 1 2 3 4 5 6 2 3 4 5 6 0 So that the output looks likes this: aaa bbb ccc ...
1
vote
3answers
80 views

Remove comma from columns in a file if it is at the end

I have a tab separated file contain 19 columns, some of these columns contain comma at the end. I want to removed these comma from all columns if it is at the end. Example: c1 c2 c3 c4 c5 ...
1
vote
1answer
82 views

Arrange data in columns

I have a big data.txt file like this: 6712,04444 6712,02344 6712,02220 6712,02233 5322,00040 5322,02230 5322,42002 4444,03342 4444,03323 11,42023 11,00000 11,23443 11,23232 and then I want to make ...
2
votes
1answer
38 views

Add/Append a column as first column to a tab delimited file

I have a Tab separated file as follows: A B HM 1 BN 2 I would like to add another column to this file such that this new column becomes the first column of the file as shown below: ...
1
vote
1answer
146 views

How to extract unique values within columns

I have a data file with 10,000 columns and 117,000 rows. my original data has a lot of repetition within each columns. it is like: inputfile.txt : 123 124 111 321 124 111 123 000 111 ...
1
vote
5answers
176 views

lines to columns with awk

I have to following sample output: <HARDWARE> <NAME>WIN1</NAME> <OS>Windows 7</OS> <IP>1.2.3.4</IP> <DOMAIN>contoso.com</DOMAIN> ...
0
votes
1answer
56 views

Read all the values of a particular column of a file and store it in another file

I have a file.txt which contains data like below: col11 col12 col13 col21 col22 col23 I fetch 2nd column of all the available rows (no. of rows may vary) using awk '{print $2}' file.txt Now i ...
2
votes
4answers
216 views

Fill empty lines in specific column with values

I have data of the following format: 2342 1 6473 2 7463 2 3647 2734 1 9343 The lines that do not have a value in the 2nd column are empty in that spot (i.e. there is no space, tab etc.). I am ...
4
votes
2answers
165 views

Adding column based on matching of second column

I have two files. The first file has the following format: 10D0325 2465 0 0 -9 -9 10D0598 2567 0 0 -9 -9 10D0562 2673 0 0 -9 -9 10D0175 2457 0 0 -9 -9 10D0241 2209 0 0 -9 -9 10D0954 2312 0 0 -9 -9 ...
-1
votes
2answers
194 views

Loop over columns and store values to associative arrays

I've got a text file containing two columns, like so: 26 0.000342231 27 0.000342231 28 0.000684463 29 0.00136893 30 0.00102669 31 0.00308008 32 0.00308008 33 0.00444901 34 0.00718686 35 0.00718686 36 ...
1
vote
3answers
80 views

Random sampling and outputting the largest value

I have a fairly large data set ~500 million rows. The data set looks like below. Col 1 is float number, col 2 is mac id(device id) 1616.93,ac:22:0b:a6:22:c3 2872.32,c0:bd:d1:36:bb:49 ...
2
votes
2answers
63 views

Output distribution to a maximal number of columns

I have a bash script foo that provides me with many short lines of output. Think ls -1. To get a more compact presentation, I would like to distribute the output over multiple columns, like ls -C. I ...
-4
votes
1answer
153 views

Removing first three characters from a column

chrII 71865 72972 YBL081W . + SGD gene . ...
3
votes
1answer
66 views

Why should you avoid “stringently columnar” input formats?

Doug McIlroy, the inventor of Unix pipes and one of the founders of the Unix tradition, had this to say at the time [McIlroy78]: (ii) Expect the output of every program to become the input to ...
-1
votes
1answer
63 views

Count of Lines within a Range

I'm trying to do a count of all the values (numeric) in the third column of a file that fall within a specific range of numbers. I've found the min and max but have no idea how to do the count now. ...
-1
votes
1answer
343 views

How to set Row & Column in shell Script

I am a beginner in shell scripting. Just made 1 script with the help of others and it is working like we expected. However i want to organize it more. Current Script { date '+%F %T'; ...
-1
votes
3answers
160 views

Need to Split the output in Row & Column

I am just a beginner in shell scripting and currently working on one script which will capture all the Endpoint Name & Ongoing calls on my switch and will send the output to one file. Output is ...
3
votes
3answers
269 views

Specific column level substitution

If I have a file with columnar entries, is it possible to substitute specific entries from a specific columns only and save changes to the same file?? Example a file abc.txt: SR|FRUITS|COLOR| ...
10
votes
5answers
1k views

Combining large amount of files

I have ±10,000 files (res.1 - res.10000) all consisting of one column, and an equal number of rows. What I want is, in essence, simple; merge all files column-wise in a new file final.res. I have ...
5
votes
3answers
253 views

Compare two files with four columns

I have two csv files with some log information. I need to compare line to line the field1 (file1) with field2 (file2) with a range of 1 minute (-00:00:01 < time < 00:00:01) and the field5 ...
1
vote
3answers
291 views

Find records present in file 1 also in both file 2 and file 3

I have three files file1.txt, file2.txt, file3.txt and they are of same format. I want to select records from file1.txt which are present in both file2.txt and file3.txt based on column 2 and column ...
0
votes
1answer
207 views

How do I center-align a column in UNIX?

I’m trying to center-align a column using the command column. The output should look like this: temperatures 50 12 89 63 How can I do this?
0
votes
1answer
264 views

make a table output

if it possible to do a snmpwalk in a perl script and put the output in a table to make a sort of association like for each hostname i have in the same line if index and desc i have the script in bash ...
0
votes
2answers
80 views

put data in columns

I am trying to put this output in columns can anyone help? Routeur 2 ==> 89.89.156.112 If_Name :vRtrIfName.1.1 :vRtrIfName.1.2 Routeur 2 ==> 89.89.156.112 If_index 546 789 Routeur 2 ==> ...
0
votes
3answers
52 views

Creating columns from text output but with multiple word columns

I have the following output: Person 49 Persons Boss 3 HR 21 CEO 93 System Administrator 2 Using column -t produces the following output: Person 49 Persons Boss 3 HR 21 CEO ...
3
votes
4answers
422 views

How do I extract the first integer from text string in a column of a tab-delimited file?

I work in Medical Genetics and often have delimited text files where in one column (ex. column 5) there is a text string with a "mutation" in our jargon: c.2458C>T or c.45_46delAA or ...
3
votes
2answers
914 views

How do I insert new columns into a .csv file?

Example Data: "Monday","12345","Friday" In the above file, I want to add a new column in between 12345 and Friday. How can I do that ?
2
votes
1answer
108 views

Produce aligned columns in a shell script

In shell how do I have an even length of spaces by the length of words on my menu? I've tried to get the length of the longest character string and then create each column length by the longest ...
0
votes
2answers
107 views

How to add a column if line contains string?

If I have a tab-delimited file containing the following lines: Sample1-Baboon 1 2 3 4 Sample2-Human 1 2 3 4 Sample3-Human 1 2 3 4 Sample4-Baboon 1 2 3 4 How can I add a new column ...
1
vote
1answer
159 views

Merge columns with the same value with awk

It is possible merge columns with the same value in awk? Something like if awk '$1 = $2' then merge I got this AZ14962 AZ14962 ctg_ 104 AZ14962 AZ14962 ctg_ 4 AZ14962 AZ14962 ctg_ 61 ...
1
vote
2answers
90 views

Make `column` use a single space as column separators in output

$ echo 'a b' | column -t a b There are 2 spaces between a and b in the output. How can I make column use only one space for separation when possible? EDIT 2: Changed data to include more cases ...
5
votes
5answers
1k views

What command(s) will feed a tab-delimited text file and cut each line to 80 characters?

I've got multiple-line text files of (sometimes) tab-delimited data. I'd like to output the file so I can glance over it - so I'd like to only see the first 80 characters of each line (I designed the ...
5
votes
2answers
88 views

Merging/Combining 2 text files according to numeric field

I have 2 text files file_1: 14595|Age 35|Salary xx|Position ax|2013|Info 1|Info 2|Info 3|Info 4|Info 5 14649|Age 30|Salary xx|Position az|2015|Info 1|Info 2|Info 3|Info 4|Info 5 file_2: ...
1
vote
2answers
586 views

Filter Large Data Sets on Dates with Command Line

I have a huge data sets that consists of tab separated values that are stored in rows. An example row looks like this: Dec 4 14:37:36.381651 algorc1 [27751:l@27932]/error: [] - [T0000A124M5] ...
1
vote
3answers
392 views

sort CSV by number of column in rows?

I have multiple CSV files with many records. The total number of rows should be 134. I have many files, and each rows has its own number of columns (from 15 to 200). I need to sort them according to ...
1
vote
1answer
66 views

Comparing value in same column and directing output to new column

I have my input file as DPortal=ECCN RemoteFile=4004_130122 0256 A02 141111 0940 29343414 11 110005 DPortal=ECCN RemoteFile=4004_130122 0256 A02 141111 2336 29843714 11 110006 DPortal=ECCN ...
0
votes
3answers
160 views

Reduce length of specific column in delimited text file

I need for the 5th column in a delimited text file to be reduced to just the first 5 characters. All other columns must remain unedited. Input: file1.txt column1 column2 column3 ...
1
vote
1answer
52 views

Insert missing string in multiple ordered columns

I have a multi-column file that looks like this: 6 93129B 177 306.98 350.20 8.84 0.23 -0.79 0.22 0.46 m 7 8 192 269.08 413.35 9.29 0.15 -0.81 ...