Skip to main content

All Questions

1 vote
3 answers
137 views

Fetch data from a large file based on time and date recursively

Fetch data based on date(column 1) and time (column 2). Each date has time in column 2. Based on each date in column1 two files are to be generated which will have all the fields based on time 6:00 to ...
Gavin's user avatar
  • 91
1 vote
4 answers
143 views

Remove duplicates by adding numerical suffix

How do I append a numerical suffix to lines to remove duplicates? Pseudo code: if currLine.startsWith("tag:") x = numFutureLinesMatching(currLine) if (x > 0) currLine = currLine + ...
Steven's user avatar
  • 758
1 vote
4 answers
343 views

Replace contents of first column which have cyclic structure

I have a file in which the first column is to be changed, for example, I have the following file (In the original file I have multiple columns but truncating the following to 2 columns, it may have ...
Akash Tadwai's user avatar
1 vote
4 answers
380 views

Sorting numerically a list

I have a text list with the following structure (all the lines on each entry start with a tab space, there are no blank lines between those lines and there is one blank line between entries): 292G.- ...
fich's user avatar
  • 330
-1 votes
4 answers
2k views

How to split columns of a CSV file into separate files?

I have csv file namely list.csv as shown below, Pcissicola19,cissicola39,12xbauhiniae BGDHLHFA_02833,DGDFDEGP_00879,POPGJMOL_04119 BGDHLHFA_01427,DGDFDEGP_03106,POPGJMOL_01558 BGDHLHFA_01618,...
Kumar's user avatar
  • 129
0 votes
3 answers
4k views

Use the 'sed' command to find a pattern and then replace everything after that using Python

I have a file like this on my Linux system, and I want it changed to the output below using a Python script. 1_file_name=xyz.vps: input0_bpp=8 input0_is_padding_enable=0 input0_task0_file_name=${...
shiny's user avatar
  • 31
5 votes
3 answers
1k views

How can I sort sections of file alphabetically?

I have a file of several sections, each section start with specific title but all of them ending with the same string, I want to sort the file sections according to the titles without sorting the ...
Mohsen El-Tahawy's user avatar
1 vote
4 answers
941 views

Sort groups of rows where field values are the same in certain columns

I have a text file like this: 1 bob A 1 jim B 1 Kate A 1 Nancy C 1 bill A 1 Jason A 2 James B 2 fill B 2 cake C 2 lucky C 2 Lucy A 2 lily B How can I order the data by column 3 within each 1 & 2 ...
Mavis's user avatar
  • 11
1 vote
3 answers
162 views

How to compare column 2 and 3 of File 1 and column 4 and 5 of file 2

I have a tab delimited file 1: NC_025345 4569 4950 KX838946.2 NC_025345 16546 17066 KJ641660.1 NC_025345 11996 12085 KX932454.2 And file 2: NC_025345.1 ...
Ibk's user avatar
  • 15
2 votes
2 answers
202 views

compare columns from two different files and PRINT RECORDS FROM FIRST FILE those that DO NOT match from second file

I would like to compare columns from file one to two. Where column 2 of file1 should un-match from column 1 or 2 from file2 and print output from file 1. file1. cat test.head20.R2.fastq.tab @...
RKK's user avatar
  • 77
3 votes
3 answers
257 views

Text Manipulation - Transpose column into rows depending on the value

I want to write a code to be able to manipulate text on my CSV file which contains the following: 71w - Rus,51200 71w - Phi,307200 71w - Ukr,307200 71w - Ukr,51200 71w - Mic,102400 71w - Mic,51200 ...
Waltiki Sucaldino's user avatar
-1 votes
1 answer
131 views

Inserting zero values into a table

I am trying to get the last column into an NxN table, but there are missing zero values. To get to the table I think I can just use awk/xarg, but would need the missing zeros? The first two columns ...
f4r7's user avatar
  • 3
1 vote
2 answers
891 views

Find value from array in one file, look up value in another file, and then use that value to find another and set as variable

So I have two files, file 1 looks like this: RR1.out RR2.out RR3.out RR4.out RR5.out RR6.out 45.7597 45.7646 45.4453 45.4448 45.2081 45....
Pyrodancer123's user avatar
0 votes
1 answer
175 views

How to replace fasta sequences in file1 from the second file2?

I have two fasta files as shown below, File1: >Contig_1:90600-91187 AAGGCCATCAAGGACGTGGATGAGGTCGTCAAGGGCAAGGAACAGGAATTGATGACGGTC >Contig_98:35323-35886 ...
Kumar's user avatar
  • 129
1 vote
2 answers
560 views

How can I extract only the pid column and only the pathname column in the lsof output?

$ sudo lsof -u t | grep -i "\.pdf" evince 1788 t 37r REG 8,4 176328 134478 /home/t/some/path1/white space/string1 + string2 string3.pdf evince 3737 t 36r ...
Tim's user avatar
  • 106k

15 30 50 per page