Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Creating a two column list of date pairs form a single column list Post 302843707 by RudiC on Wednesday 14th of August 2013 01:47:05 PM
Old 08-14-2013
Try (for seven dates):
Code:
awk '{T[NR]=$1} END {for (i=1; i<NR; i++) {for (j=i+1; j<=NR; j++) print T[i], T[j]}}' file
date1 date2
date1 date3
date1 date4
date1 date5
date1 date6
date1 date7
date2 date3
date2 date4
date2 date5
date2 date6
date2 date7
date3 date4
date3 date5
date3 date6
date3 date7
date4 date5
date4 date6
date4 date7
date5 date6
date5 date7
date6 date7

 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Sorting list of files per date column

Hi all, I have a pecular issue in sorting these files (not an ls -lrt) in Solaris environment. All the below files are modified on November 4th, but I want to sort these files as per date (eg: 01May07_1623 = ddmmmyy_hhmm) Nov 4 18:27 SONYELEC00.GI22973.01May07_1623.gpg Nov 4 18:27... (10 Replies)
Discussion started by: shivaastrogun
10 Replies

2. 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

3. UNIX for Dummies Questions & Answers

creating a file using the fist column and printing second column

Hello all. I have a problem that I need help solving. I would like to convert the following file: human pool1_12 10e-02 45 67 human pool1_1899 10e-01 45 29 human pool1_1829 10e-01 43 26 horse pool1_343 10e-20 65 191 horse pool1_454 10e-09 44 43... (5 Replies)
Discussion started by: viralnerd
5 Replies

4. UNIX for Advanced & Expert Users

need to get single column form csv file

hi 2 all i need to get single column from one csv file anyone help me ! >cat file.csv name,age x,1 y,2 z,3 Use code tags please, ty. in this "file.csv" file i need only name column can u help me !:b::b: (7 Replies)
Discussion started by: ponmuthu
7 Replies

5. Shell Programming and Scripting

Construct 3 column table from one column list

Hi all! trying my best to parse a public site for information (ie fiscal year and turnover) about corporations. Doing this by having a file with business name and registration number (search key) the file bolag.txt currently looks like this Burgundy 556732-7217 AcademicSearch 556406-9879... (11 Replies)
Discussion started by: martindebruin
11 Replies

6. UNIX for Dummies Questions & Answers

Creating a column based list from a string list

I have a string containing fields separated by space Example set sr="Fred Ted Joe Peter Paul Jean Chris Tim Tex" and want to display it in a column format, for example to a maximum of a window of 100 characters And hopefully display some thing like Fred Ted Joe ... (3 Replies)
Discussion started by: kristinu
3 Replies

7. UNIX for Dummies Questions & Answers

List several files into one single column

frtgyh (2 Replies)
Discussion started by: lucasvs
2 Replies

8. Shell Programming and Scripting

Converting Single Column into Multiple rows, but with strings to specific tab column

Dear fellows, I need your help. I'm trying to write a script to convert a single column into multiple rows. But it need to recognize the beginning of the string and set it to its specific Column number. Each Line (loop) begins with digit (RANGE). At this moment it's kind of working, but it... (6 Replies)
Discussion started by: AK47
6 Replies

9. Shell Programming and Scripting

Bring values in the second column into single line (comma sep) for uniq value in the first column

I want to bring values in the second column into single line for uniq value in the first column. My input jvm01, Web 2.0 Feature Pack Library jvm01, IBM WebSphere JAX-RS jvm01, Custom01 Shared Library jvm02, Web 2.0 Feature Pack Library jvm02, IBM WebSphere JAX-RS jvm03, Web 2.0 Feature... (10 Replies)
Discussion started by: kchinnam
10 Replies

10. Shell Programming and Scripting

Get maximum per column from CSV file, based on date column

Hello everyone, I am using ksh on Solaris 10 and I'm gathering data in a CSV file that looks like this: 20170628-23:25:01,1,0,0,1,1,1,1,55,55,1 20170628-23:30:01,1,0,0,1,1,1,1,56,56,1 20170628-23:35:00,1,0,0,1,1,2,1,57,57,2 20170628-23:40:00,1,0,0,1,1,1,1,58,58,2... (6 Replies)
Discussion started by: ejianu
6 Replies
COLRM(1)						    BSD General Commands Manual 						  COLRM(1)

NAME
colrm -- remove columns from a file SYNOPSIS
colrm [start [stop]] DESCRIPTION
The colrm utility removes selected columns from the lines of a file. A column is defined as a single character in a line. Input is read from the standard input. Output is written to the standard output. If only the start column is specified, columns numbered less than the start column will be written. If both start and stop columns are spec- ified, columns numbered less than the start column or greater than the stop column will be written. Column numbering starts with one, not zero. Tab characters increment the column count to the next multiple of eight. Backspace characters decrement the column count by one. ENVIRONMENT
The LANG, LC_ALL and LC_CTYPE environment variables affect the execution of colrm as described in environ(7). EXIT STATUS
The colrm utility exits 0 on success, and >0 if an error occurs. SEE ALSO
awk(1), column(1), cut(1), paste(1) HISTORY
The colrm command appeared in 3.0BSD. BSD
August 4, 2004 BSD
All times are GMT -4. The time now is 07:15 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy