The tag has no wiki summary.

learn more… | top users | synonyms

2
votes
3answers
45 views

A shell tool to “tablify” input data containing ANSI escape codes

I have input containing ANSI color codes that I'd like to tablify. I want the output to remain colored, so the tablified output should maintain the ANSI color codes. Hence, naively stripping them away ...
2
votes
1answer
214 views

text processing-perl

I am a biologist. I would like help of computer experts to help in text file editing. Here is what the input file looks like: ##dsfsd2 ##sdf-sdf sasg 5.6.3 gi34_ex Gen CDS 161 317 . ...
2
votes
3answers
55 views

Append columns in a text file to after the final row

A smaller version of many data files I have looks like this: 0 0 0 0.05 9.6877884e-06 0.0024898597 0.1 4.2838688e-05 0.0049595502 0.15 0.00016929444 0.0074092494 0.2 0.00036426881 0.009839138 0.25 ...
1
vote
1answer
62 views

Why doesn't this unexpand seem to work?

It's my understanding that unexpand can replace multiple spaces with tabs. I have a file, x.x with contents 1 2 3 4 5 and I type expand x.x but the output is still 1 2 3 4 5 and ...
1
vote
1answer
605 views

i/o format with printf in bash-shell

I am trying to output the results of my shell script using printf. To keep the results aligned in column, I am using tab as: printf "%s\t %s\t %s\t %s\t %s\t %s\t %s\n" $i $est $var_m $jk $mst $var_M ...
1
vote
3answers
139 views

Find matches for the 5th columns in a pipe delim files

File 1: Connect|20130320000023|UTC|PPP|test3@test3.co.uk|test1@test1.co.uk|0BCBE578| File 2: Connect|20130320000023|UTC|PPP|test1@test1.co.uk|test1@test1.co.uk|0BCBE578| ...
1
vote
3answers
152 views

How to sort and join at the same time?

I have 2 files, one having 2 columns, another having 1 column. The second file is sorted using sort -u. Now the task is I need to join this column with the first column of the first file, which is not ...
1
vote
1answer
77 views

Transpose several columns (of varying lengths) into rows

A similar question to mine was asked that concerned transposing multiple columns into rows. However, the particular column format that I am dealing with is slightly different in that my file contains ...
1
vote
1answer
133 views

Transposing multiple columns is a row

I need to transpose a file from this format 1 2 3 4 6 7 8 9 a b c d f g h i j to this format 1 2 6 7 a b f g 3 4 8 9 c d h k two columns in a single row in the way posted above. Any ...
1
vote
3answers
508 views

Split long output into two columns

Is there a simple utility or script to columnate the output from one of my scripts? I have data in some form: A aldkhasdfljhaf B klajsdfhalsdfh C salkjsdjkladdag D lseuiorlhisnflkc E sdjklfhnslkdfhn ...
1
vote
1answer
574 views

Sorting by one column then the

Say i have a output file with following: 010513 08:04 ROUTER1 192.168.1.1 68.130.5.10 HIT(1) 010513 08:04 ROUTER1 172.168.1.1 28.130.5.10 HIT(1) 010513 08:04 ROUTER1 122.168.1.1 ...
1
vote
1answer
192 views

Combining files with 4 columns each, into 4 files for each column [closed]

So I have a bunch of text files which look like this: T1 r1 a b c d r2 d e f g ... T2 r1 h i j k r2 l m n o ... And I want to make FOUR different text files in the following ...
1
vote
2answers
77 views

Split out data from a column

So at the moment I have some input email addresses and would like to separate the alias and the domain, then copy them to the end of the line. For example, from a line that has ...
0
votes
3answers
64 views

removing spaces from first column

My input file has positions in first column with different number of spaces (or no space) 16504 16516 1650811 16520 1651 16524 16516111 16528 165204 16532 ...
0
votes
3answers
98 views

ps output differs when run from command line and from script

I have to create list of PID's of the running processes. Here is the script ps echo "fields are " ps | cut -d' ' -f1 ps is showing PID TTY TIME CMD 2168 pts/4 00:00:00 sh 2177 ...
0
votes
1answer
474 views

shell script to print rows if there is a value in column 2

1 **2** 3 4 3 1 4 2 1 4 3 2 4 **2** 1 3 How can I print all rows, on which there is a 2 in the second column.
0
votes
1answer
81 views

how to assign values of the column for given conditional statements

I need help with a script to assign values of the column with a given conditional argument. To be specific, here is my data and my condition input data.file: 0.4 3.6 -2.4 0.1 -2.0 1.6 2.2 3.6 ...
0
votes
3answers
842 views

Shell script read separately columns from file

When we have file which is a kind of list like : Mary 34 George 45 John 56 Josh 29 using the awk command $1 refers to the first column and $2 to the second column.But once we write a shell script ...
0
votes
1answer
103 views

moving columns across rows

I am dealing with a txt file and trying to keep the first column/field in place, but shift the 2nd column down by 1 row. I tried this, but it gave the error unmatched .'s. awk '{for(i=1; i<NR; ...
0
votes
2answers
565 views

Align columns in ASCII file

I have a text file that looks like his: #c1 c2 c3 c4 c5 c6 c7 c8 c9 c10 c11 c12 c13 4599 995,274 2523,658 ...
0
votes
1answer
41 views

How to display data in columns in two variables with the same format?

I coded the following to display data formatted in columns: str1='hello i am robert and your ma frnd' str2='thisisaverylongword thisistoohehehe andherefinishthe string hereis a other ...
-1
votes
1answer
63 views

Display column that has a specific string

Content of a sample file is as follow: AA BB CC DD BB 1 2 3 4 9 5 6 7 8 10 I want to display the whole columns that contain BB and DD. In the real case, I do not know which columns contain ...