Search Results

Search: Posts Made By: yifangt
Forum: Programming 1 Week Ago
866
Posted By yifangt
Thanks! Corona688 in this forum had similar...
Thanks!
Corona688 in this forum had similar code, but I skipped that part not to making my question too branchy.
Forum: Programming 1 Week Ago
866
Posted By yifangt
I was so stupid when you first pointed out that I...
I was so stupid when you first pointed out that I should add a line to empty str1 with str1[0]=0; but I thought you had typos so that I simply added the single quotes: str1[0]='0'; Last night I...
Forum: Programming 1 Week Ago
866
Posted By yifangt
last variable gets printed twice
Thanks!
Change the char array size ID[12], str1[12] resolved the ID bug!

Last bug(hopefully!): the last variable is printed twice, that I really could not understand.
#include <stdio.h>...
Forum: Programming 1 Week Ago
866
Posted By yifangt
last field for sscanf() is incorrectly parsed
Change the RECORD increment i++; according to your correction fixed the problem!
Thank you so much!
---------------------------------------------------------------------------
Wait! There is...
Forum: Programming 1 Week Ago
866
Posted By yifangt
segment fault
Thanks, did you try the attached file with 4 RECORD?
I always got segment fault at the same spot of the input, i.e. the 10th variable TotalHetHomRatio[8] within the 2nd RECORD, sample2.
Also I...
Forum: Programming 1 Week Ago
866
Posted By yifangt
whole program buggy code
Thanks!
Then there must be something else wrong with my program. I decided to post the whole program here seeking more help to debug. A test file is also attached for trial.

#include <stdio.h>...
Forum: Programming 2 Weeks Ago
866
Posted By yifangt
Format specifier for sscanf() in C
Hello, I have formatted lines delimited by colon ":", and I need to parse the line into two parts with sscanf() with format specifiers.
infile.txt:
Sample Name: sample1
SNPs ...
2,928
Posted By yifangt
Bash variable expansion in awk script
Hello,
I need to split a file into two of different locations by re-direction in awk.
cat infle
aaa 1 3
bbb 2 4
aaa 3 3
bbb 4 4
aaa 5 3
bbb 6 4

cat...
1,878
Posted By yifangt
Scrutinizer: Could you elaborate this part ? ...
Scrutinizer:
Could you elaborate this part ?

FS=RS; RS=">";I tried FS=RS=">"; but it did not work. What's the difference between the two: FS=RS; RS=">"; vs FS=RS=">";
1,878
Posted By yifangt
That's exactly what I meant! Thanks RudiC!
That's exactly what I meant!

Thanks RudiC!
1,878
Posted By yifangt
combine and upgrade by the second fasta file
I put my answer back as I met the scenarios:
1) when file2.fasta contains more entries than in file1.fasta and vice versa. and
2) when the sequence part can have more than one row;
awk...
424
Posted By yifangt
Thanks! Original question is about the...
Thanks!
Original question is about the synchronizing of echo and wc -l output, but this definitely enhanced more than I expected. I just installed pigz, and will give it try soon.
424
Posted By yifangt
parallel to restrict the process number
@bakunin @all
Your comments are exactly what I wanted to catch. Here, I reformed my script with GNU parallel to control the process limits, but I hit another wall:
parallel -a $LIST1 -j 48...
424
Posted By yifangt
@Rudic No, still the same as the original...
@Rudic
No, still the same as the original problem.
I'll do the single files and then concatenate them. Thanks!
424
Posted By yifangt
Attach filename to wc results on massive number of files
Hello,
I have massive number of big files that needed to be counted for the total number of lines (> 100x millions) each. I want the file name attached to the count results so that they are aligned...
390
Posted By yifangt
Thanks RudiC! I like these tricks: SUM[$1...
Thanks RudiC!
I like these tricks:
SUM[$1 OFS int($2/100)*100] #A very good trick to me for simple situations
...
for (s in SUM) {split (s, T, OFS)
if ($1 == T[1] && $2 >= T[2] && $2...
390
Posted By yifangt
Yes, they are grouped and sorted nicely.
Yes, they are grouped and sorted nicely.
390
Posted By yifangt
Each N1 range is different without overlapping...
Each N1 range is different without overlapping for sure, as they are evenly spaced except the last one. Say N1 has 7550bp long, that it is modulo-ed by 100, the last range would be N1 7500 7550.
...
390
Posted By yifangt
What overlapping problem? Using column 3, those...
What overlapping problem? Using column 3, those do not overlap. Are we intended to count column 2 as well?
What I meant "overlapping" was for the range, for example:

this line N1 48 181 2 ...
390
Posted By yifangt
How to sum value of a column by range defined in another file awk?
I have two files, file1.table is the count table, and the other is the range condition file2.range.
file1.table
chr start end count
N1 0 48 1
N1 48 181 2
N1 181 193 0
N1 193 326 2
N1 326...
399
Posted By yifangt
Thanks Rudic! Before I try your method, does...
Thanks Rudic!
Before I try your method, does this grep -F chr1A file*.tab swallow all the 80 files (~2400GB!) in memory first?
399
Posted By yifangt
I will do with the second suggestion. Thanks!
I will do with the second suggestion. Thanks!
399
Posted By yifangt
How to control grep output intact for each matching line?
I have multiple (~80) files (some can be as big as 30GB of >1 billion of lines!) to grep on a pattern, and piped the match to a single file. I have a 96-core machine so that each grep job was sent to...
Forum: Programming 07-16-2018
964
Posted By yifangt
Thanks Jim and Corona: I was not sure the NULL...
Thanks Jim and Corona:
I was not sure the NULL terminator was handled correctly.
If str1 precedes str2 in memory and each one is word-aligned, then the last character you write to str1[128]...
Forum: Programming 07-13-2018
964
Posted By yifangt
unclear with memset() with strcpy()/strncpy()
Thank you so much for your patience with my basics still, as I feel getting better to understand more.
strncpy doesn't want the size of the origin string: It wants the size of the destination...
Showing results 1 to 25 of 500

 

Featured Tech Videos

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