Search Results

Search: Posts Made By: torchij
401
Posted By torchij
A beautiful solution! Appears to work as...
A beautiful solution! Appears to work as expected, and is ~2000x faster then grep'ing to disk a million times.

Thanks very much!
401
Posted By torchij
Help reformatting column
Hello UNIX experts,

I'm stumped finding a method to reformat a column. Input file is a two column tab-delimited file. Essentially, for every term that appears in column 2, I would like to...
800
Posted By torchij
That appears to have done the trick! Thanks...
That appears to have done the trick!

Thanks so much!
800
Posted By torchij
Help with awk solution to add columns
Hi all. Wondering if someone can help with an awk solution to a problem I'm stumped with.

I have a matrix file with >1000 fields and would like to add another column after each column with a text...
1,422
Posted By torchij
My apologies, here are some numbers. The file I'm...
My apologies, here are some numbers. The file I'm using has 252 "pieces" and 49,134 lines total.
I like the csplit option, its clean and gives options:

time csplit -f test_ -n3 -s...
1,422
Posted By torchij
Wow thanks so much, both awk options and the...
Wow thanks so much, both awk options and the csplit command worked. I really appreciate the help.
1,422
Posted By torchij
Script to break up file (write new files) in bash
Hello experts, I need help writing individual files from a data matrix, with each new file being written every time there is a blank line:

From this

cat file.txt
col1 col2 col3
6661 ...
2,583
Posted By torchij
Many thanks, both solutions appear to work! ...
Many thanks, both solutions appear to work!

Cheers!
2,583
Posted By torchij
awk solution to duplicate lines based on column
Hi experts, I have a tab-delimited file with one column containing values separated by a comma. I wish to duplicate the entire line for every value in that comma-delimited field.

For example:

...
696
Posted By torchij
This is very close to what I wanted, but it does...
This is very close to what I wanted, but it does this for every pair. I need it to do the first 2 columns (2&3) and then the next two columns after 2 and 3 (4&5).
Right now the code is doing 2$3,...
696
Posted By torchij
I know awk would be best for this, I haven't been...
I know awk would be best for this, I haven't been able to figure it out. I'm quite the newb. It's the "every 2 columns" part that I don't know how to code.

I know how to do this:

awk -F "\t"...
696
Posted By torchij
Help with solution to add together columns of large file
Hi everyone. I have a file with ~500 columns and I would like to perform a simple calculation on every two columns. The file looks like this:


$cat input
id A B C D E F.....X
1 2...
1,138
Posted By torchij
Thanks to both. Each solution appears to work...
Thanks to both. Each solution appears to work fine.

Many thanks.
1,138
Posted By torchij
[Solved] Replace NA with column mean
Hi experts, I'm looking for a unix solution to replacing "NA" within a matrix with the mean of the column:


$cat file
ID a b c d
day 10 5 100 50
cat ...
1,598
Posted By torchij
Thanks so much that appears to work! I think it...
Thanks so much that appears to work! I think it was just missing a quote before "NEWcol"

Many thanks for your reply.
1,598
Posted By torchij
[Solved] awk solution to add sequential numbers based on a word
Hi experts, I've been struggling to format a large genetic dataset. It's complicated to explain so I'll simply post example input/output


$cat input.txt
ID GENE pos start end...
1,053
Posted By torchij
Seriously it's that easy?? I should have known...
Seriously it's that easy?? I should have known that because I do that for bash loops...

Many thanks,
torch
1,053
Posted By torchij
Merge columns from multiple files
Hi all, I've searched the web for a long time trying to figure out how to merge columns from multiple files.

I know paste will append columns like so:

paste file1 file2 file3 file4 file5 ... ...
1,210
Posted By torchij
Thanks so much that works perfectly!
Thanks so much that works perfectly!
1,210
Posted By torchij
Hi, I'll try to be more clear with the example. ...
Hi, I'll try to be more clear with the example.

Thanks for the response, here is an example, i'll focus on just the second column

input

$ cat file.2.txt
3
2
1
10
10
10
25
30
60
The...
1,210
Posted By torchij
Thanks for the response, here is an example: ...
Thanks for the response, here is an example:

input

$ cat file.txt
1 3
2 2
3 1
4 10
5 10
6 10
7 25
8 30
9 60


output example 1 (using...
1,210
Posted By torchij
awk solution for taking bins
Hi all, I'm looking for an awk solution for taking bins of data set.
For example, if I have two columns of data that I wish to use for a scatter plot, and it contains 5 million lines, how can I take...
13,274
Posted By torchij
Thank you so much for your very clear reply! That...
Thank you so much for your very clear reply! That was very helpful.
13,274
Posted By torchij
Thanks for your response, Alister. What do...
Thanks for your response, Alister.

What do you mean by unsynchronized? The example I gave was just for simplicity, but typically the scripts are perl or python programs that read the file...
13,274
Posted By torchij
Read same file simultaneously with two different programs
Hi all, I was just wondering if there are any consequences, or if its a problem to have a multiple scripts parsing (reading) the same file simultaneously.

For example, I have file.txt with lots of...
Showing results 1 to 25 of 71

 

Featured Tech Videos

All times are GMT -4. The time now is 10:11 AM.
Unix & Linux Forums Content Copyright 1993-2020. All Rights Reserved.
Privacy Policy