All Questions
Tagged with perl command-line
25
questions
0
votes
1
answer
204
views
How can I create a .txt file containing data being generated in real-time in Linux terminal when a program is running?
I am running an AutoDock Vina program (using a Perl script) in Linux.
It generates lots of important data
(regarding binding free energy of protein-ligand docked complexes).
However, I cannot save ...
0
votes
2
answers
451
views
Extract function string before function name with regex
I want a regex that would search for something like:
package_name.some_function_name.foo()
that would be part of a line and would and extract the some_function_namebut it should be able to work ...
3
votes
4
answers
477
views
Expanding comma separated list in a tab-delimited file into separate lines
I have a very similar problem to this question, but have no idea how to adapt the answer to my own issue.
I have a tab-sep file with 2nd column containing comma-sep list, such as:
TRINITY_DN1_c0_g1 ...
0
votes
1
answer
183
views
What does \L$2 mean in perl rename tool?
I see this command advised, whenever a person asks online about renaming all uppercase files to lowercase:
find "$(pwd)" -depth -exec rename 's/(.*)\/([^\/]*)/$1\/\L$2/' {} \;
I understand ...
-1
votes
3
answers
277
views
how to assign values to intervals with overlapping regions?
I have two big files, the first file contain some intervals with 85K rows:
head data.intervals
id id_uniq numberA numberB
1 g1 5 20
1 g2 6 29
1 g3 17 35
1 g4 37 46
1 g5 50 63
1 ...
1
vote
2
answers
1k
views
How to start a new column after every nth row?
I have a file (comma separated) on a Linux system with 3 columns. I want to start new column after every 4th row.
Input:
col1,col2,col3
1,disease1,high
1,disease2,low
1,disease3,high
col1,col2,...
5
votes
2
answers
3k
views
Perl command line regex to modify all pattern matches
I'm trying to use some arithmetic over the matched patterns in perl command line. I'm able to do it for one match but not for all.
str="a1b2c3"
perl -pe 's/\d+/$&+1/e' <<<"$str"
a2b2c3
...
3
votes
1
answer
1k
views
Remove multiple strings from file on command line, high performance [closed]
Is there an elegant, high-performance one-liner way to remove multiple complete strings from an input?
I process large text files, e.g., 1 million lines in inputfile, and 100k matching strings in ...
0
votes
6
answers
3k
views
awk/sed/perl one liner to edit json file
We want to add the folwing lines:
export KAFKA_HEAP_OPTS="-Xmx8g -Xms8g"
and:
export KAFKA_JVM_PERFORMANCE_OPTS=" -XX:MetaspaceSize=96m -XX:+UseG1GC-XX:MaxGCPauseMillis=20 - XX:...
2
votes
1
answer
253
views
replacing values in one with the values in another file
I have a csv file named eche in following format:
INCON,--,INITIAL,CONDITIONS,FOR*****,ELEMENTS,AT,TIME ,0.315570E+13
VC76,0.10000000E+00,0.2837726135782E+08,0.6756896308414E+02
1K02,0.10000000E+00,0....
1
vote
1
answer
216
views
pairwise combination of string based on two columns
I am trying to obtain the pairwise combination of of string available for each stack of data,
input file contains two columns: col1 is genenames, col2 is name of various stressors.
gene1 ...
2
votes
1
answer
720
views
Install program with Perl?
I'm trying to install GTK YouTube Viewer from GitHub (https://github.com/trizen/youtube-viewer) in Q4OS (Debian-based).
I downloaded the .zip file and extracted it, then tried to run the first ...
1
vote
2
answers
162
views
What Type Of Data does the Input File Contain?
I have a folder with more than 10000 text files. The files can be of two types:
Type1: called “DNA”
Format:
header information starting with “>”
Line 2 onwards contains only the following letters:...
0
votes
1
answer
128
views
Transpose CSV file by the value of a column
Input:
X Y
1 11
1 12
2 21
2 22
Desired Output:
11 12
21 22
I want to transpose the CSV file by the value of column 1. In this example, for X = 1, transpose (11, 12)^T to (11, 12); for X = 2, ...
1
vote
1
answer
220
views
Rename command to delete substring
I am trying to batch rename the following files:
art-faculty-3_29060055362_o.jpeg
fine-arts-division-faculty-2016-2017-5_29165851925_o.jpeg
theatre-faculty-2016-2017-1_29132529356_o.jpeg
art-...