Search Results

Search: Posts Made By: ssshen
4,526
Posted By ssshen
Thanks for the new code, but it didn't do loop. ...
Thanks for the new code, but it didn't do loop.

---------- Post updated at 04:17 PM ---------- Previous update was at 04:14 PM ----------

sorry, I think I know what's my problem. Because of...
4,526
Posted By ssshen
Thank you, vgersh99. This is way beyond my...
Thank you, vgersh99.

This is way beyond my ability, a biologist. But your code didn't generate separated new files, instead it lists all things in one file.

Thanks again,
4,526
Posted By ssshen
I don't know what to do, but tried copy/paste and...
I don't know what to do, but tried copy/paste and transpose. Any idea?
4,526
Posted By ssshen
Hi vgersh99, for the first question, I tried...
Hi vgersh99,

for the first question, I tried your code that worked perfectly. For this one, I didn't get any reply yet. I thought awk and/or sed will work.

Thanks,
4,526
Posted By ssshen
split a file into many files
Hello,

Here is another one. The file type is almost same, many lines and many fields. What I need to do is to extract each line of old file and make it a new file, and in the new file, the field1...
5,092
Posted By ssshen
right, but deserve my many thanks too!
right, but deserve my many thanks too!
5,092
Posted By ssshen
You guys are the best! Thank you so much.
You guys are the best! Thank you so much.
5,092
Posted By ssshen
insert a field into a tab delimited file
Hello,

Can someone help me to do this with awk or sed? I have a file with multiple lines, each line has many fields separated with a tab. I would like to add one more field holding 'na' in between...
5,677
Posted By ssshen
Thank you folks so much! But it didn't work for...
Thank you folks so much! But it didn't work for me with both awk or Tcl. By the way, I wanted to filter absolute value. Second, I use Mac OS 10. Third The file is much bigger than the sample part.
5,677
Posted By ssshen
can someone please make it work?
the filter based on absolute value, X1>=0.5 and X1<=0.5.

Thanks
5,677
Posted By ssshen
but what I meant is absolute value >=0.5,...
but what I meant is absolute value >=0.5, thanks!
5,677
Posted By ssshen
extract data from a data matrix with filter criteria
Here is what old matrix look like,

IDs X1 X2 Y1 Y2
10914061 -0.364613333 -0.362922333 0.001691 -0.450094667...
2,830
Posted By ssshen
mine is ox10
mine is ox10
2,830
Posted By ssshen
awk didn't work
it is awk
2,830
Posted By ssshen
1,750
Posted By ssshen
instead of fancy loop, this might work too,
awk -F"," 'FNR==NR {a[$1]++; next} a[$1]' A B >foo | diff A foo > A-diff

Many thanks to Sha
1,750
Posted By ssshen
Thank you so much, Sha.
Yours worked! but another one you recommended didn't work.

Could you please help me find out what's going on?

awk 'FILENAME=="file1" {arr[$0]++}
> FILENAME=="file2"{ if($0 in arr)...
3,371
Posted By ssshen
Thank you, Sha.
I wasn't realize that there will be delay between posted and then actually seen.
1,750
Posted By ssshen
thanks, but it didn't work
awk: can't open file FNR==NR {a[$1]++; next} a[$1]
source line number 1 source file FNR==NR {a[$1]++; next} a[$1]
context is
>>> <<<
3,371
Posted By ssshen
Thanks, but
this isn't a school work. I just want to see if scripting language can do something when a database is not available.
1,750
Posted By ssshen
Can awk or sed do this?
I have two spreadsheet files (A, B). Each has many rows with IDs. First, I want to find out the contents in both files with common IDs. Second, I want find the contents which only exist in A not B.
...
3,371
Posted By ssshen
need shell script for this challenge problem
two tabulate files (A, B), each contents thousands and thousands lines with ids.

first find out contents with common ids in both A, B and print out into a file;
second find out contents with ids...
2,256
Posted By ssshen
I modified code slightly by putting FS="\t" ahead...
I modified code slightly by putting FS="\t" ahead of val and it worked! As I executed code I got two more problems. First, the row header in eash file should be omitted. Second, there are some...
2,256
Posted By ssshen
Thanks so much. It works well if original file...
Thanks so much. It works well if original file doesn't have space in the contents. But how to specify a tab or comma delimited file as input?

Thanks again.
2,256
Posted By ssshen
file editting with shell programmin
Hello,

I have several handreds of text files. The format of file looks like:

column1 column2 column3 column4 column5
id1 definition1 name1 ...
Showing results 1 to 25 of 25

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