Search Results

Search: Posts Made By: rossi
3,536
Posted By rossi
Thanks Fraklin and Aia, It works, I will try...
Thanks Fraklin and Aia,

It works, I will try to understand the logic of doing these tasks in the future.
3,536
Posted By rossi
Hi Shilpi, the output from your code is ...
Hi Shilpi,

the output from your code is



I am looking for something else.

But thanks, it might be useful for other problems.
3,536
Posted By rossi
Process a file for line count using for loop in awk
Hi,

I have a file with contents



So what I have to do is


In short, break the file after every 6 lines and then truncate new line to tab for these 6 lines.
I am not able to execute the...
1,586
Posted By rossi
Hi rabtte1 The code from Scrutinizer works...
Hi rabtte1

The code from Scrutinizer works for the problem I posted.
Yes there are more lines in the file, but I want the number just from the 2nd line.
I want the number before the |...
1,586
Posted By rossi
Thanks!!! The code works fro this problem. ...
Thanks!!!
The code works fro this problem.
Can you help in solving this issue
suppose the file name is
abc7634.txt
def87.txt
kslkd836990.txt
Assuming that kslkd has 12 inside the file

I...
1,586
Posted By rossi
Help with naming the file
Hi,

I have a folder that contains files

abc.txt
def.txt
....and so on

Inside abc.txt, I have @<TRIPOS>MOLECULE...
1,686
Posted By rossi
Sorry, I missed it so took it out from the thread...
Sorry, I missed it so took it out from the thread now

---------- Post updated at 12:56 PM ---------- Previous update was at 11:53 AM ----------

Thanks RudiC,

The code for the second problem...
1,686
Posted By rossi
HI RudiC, I have edit the tags. The 3rd...
HI RudiC,

I have edit the tags.

The 3rd last line is printed like that because now there isn't anything matching in file 1 and file to so the unmatched things are being printed side by side....
1,686
Posted By rossi
Match and print based on columns
HI,

I have 2 different questions in this thread.
Consider 2 files as input (input file have different line count )
File 1
1 1 625 56
1 12 657 34
1 9 25 45 1
2 20 54 67
3 25 35 27
4 45 73...
2,101
Posted By rossi
You are right Scrutinizer. I am bad in posting...
You are right Scrutinizer.
I am bad in posting the file format as I always get confused how to do it properly here. Next time, I will do it more carefully.

But the last script from you works...
2,101
Posted By rossi
Hi Rudy, Yes, that's the thing what I want...
Hi Rudy,

Yes, that's the thing what I want to achieve in the task.
2,101
Posted By rossi
Hi I understand now from the comments what...
Hi

I understand now from the comments what i=4 does in this example.

But what if I don't know the exact positions of the columns which has 0 0 in the 1000 column file. Let's suppose an example,...
2,101
Posted By rossi
Hi Sorry, the example has 5 columns. ...
Hi

Sorry, the example has 5 columns.
Lets's take the 1st row
There is a space between A A, tab 0 0, tab G G, tab 0 0, tab T T.
Column three won't always be retained.

---------- Post...
2,101
Posted By rossi
Replacing characters in a file
Suppose I have a file which has 1000 columns (5 SHOWN FOR EXAMPLE)
two alphabets are separated by a space and then tab
A A"\t"C C"\t"G G"\t"0 0"\t"T T
A G"\t"C C"\t"G G"\t"A T"\t"0 0
G A"\t"0...
1,717
Posted By rossi
MAybe it's more clear now ---------- Post...
MAybe it's more clear now

---------- Post updated at 09:18 PM ---------- Previous update was at 09:15 PM ----------

In a folder there is a1.txt, b2.txt, c3.txt....

Inside a1.txt :
id :...
1,717
Posted By rossi
Hi, I want to pick the name of the new file...
Hi,

I want to pick the name of the new file from id. So here the id is 1402_3853 and therefore the file name should be 1402_3853.can.txt..

So I want a file named $id.can.txt that has one...
1,717
Posted By rossi
Help with bash
Hi,

From a folder which contains like 250 *.txt files, I want to do egrep -i "can't|cannot|CANCELLED". for all the files and then save each file that can't run as $id.can.txt

Example of the...
2,663
Posted By rossi
HI all, I solved the problem in a different ...
HI all,

I solved the problem in a different

from collections import defaultdict
import sys

d = defaultdict(list)

with open (sys.argv[1]) as f:
for line in f:
...
2,663
Posted By rossi
My data is like this : chr12 21007916 ...
My data is like this :

chr12 21007916 21377807 369.89 -3.12 RP11-125O5.2
chr12 21007916 21377807 369.89 -3.12 SLCO1B1
chr12 21007916 21377807 ...
2,663
Posted By rossi
Hi Wisecarcker : I want to convert the...
Hi Wisecarcker :

I want to convert the whole column into int. all alphanumerical characters in string.

Python version 2.7
OS linux
1,170
Posted By rossi
result=`echo $string | egrep -o...
result=`echo $string | egrep -o "[0,9]{1,5}"`
2,663
Posted By rossi
Convert int to string in python
Hi,

I have column 5 in a file which contains string like this for ex.

RP11-125O5.2
SLCO1B1
CAPN1
FRMPD2
TXNL4B

So I do by

data = [map(int,cols[5])]
ValueError: invalid literal for...
1,503
Posted By rossi
Thanks for the reply. But what if I have more...
Thanks for the reply. But what if I have more than 100 files and the length of name is suppose 50 characters(includes the path).

---------- Post updated at 04:25 PM ---------- Previous update was...
1,503
Posted By rossi
2,510
Posted By rossi
Tried the solution which you suggested var1=1a ...
Tried the solution which you suggested
var1=1a
var2=2b
var3=3c
out='mktemp -p /scratch/ccg-ngs/tmp/vishal/tmp/ ${var1}XXXX || exit1'
cat_out='mktemp -p /scratch/ccg-ngs/tmp/vishal/tmp/...
Showing results 1 to 25 of 27

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