I am a beginner in perl and I am trying to write a perl script. Basically I want to separate gene entries from phenotype entries in a text file which contains huge number of records and copy them in a separate file. The gene entries will have * symbol after the line FIELD TI. A sample of a record is given below.
It would be really great if someone could help me with this.
Last edited by Scrutinizer; 05-03-2012 at 02:09 AM..
Reason: code tags
Hi corona688 and Skrynesaver,
Thank you so much for the reply. And for the program skrynesaver gave, thank you so much. It was so helpful. But with that program,even entries without " * " after the line FIELD TI is being printed. I want only the entries with " * ". I would like to be more specific with the input I have and the output expected.
The text file I have is with 21,000 records with explanation given for each entries. All the entries start with the line RECORD. I have attached a split file with this so you all can have an idea about what I am talking about exactly.
WHAT I REQUIRE FROM THE PROGRAM
1. to separate gene entries from phenotype entries and want all the gene records to be copied in a new file and phenotype records to be copied in another file.
gene entries will start with * (asterisk) symbol after the line "FIELD TI". phenotype entries might not have any symbol or might start with # or %.
2. I want the output records to be in a copied in a separate file.
Gene entries in a separate file and phenotype entries in a separate file
The output file with just the entries should like for example
3. I actually need two files for gene entries. one file will have the separated gene records with the record number and description given in the same line as the above example.
The second file should have all the information of the gene records as the example given below.
the file with all the information of the records should have like
Hi all.
I am working on the below requirement of generating .xml file from .xls file which i have , can someone please help me or in writing the perl script for the same:
The xls file format is as below which has two columns and number of rows are not fixed:
Fixlet Name ... (12 Replies)
Hey everyone... I'm just stretching my wings a bit and seeing how things work. If I wanted to write a script that had me ssh to my remote computer, how can this be done? If the script runs without me, how can I enter the required password? the same is true for any time of authentication method like... (2 Replies)
Hi,
I am new to perl.
I am trying to write a small perl script for search and replace in a file :
========================================================
#!/usr/bin/perl
my $searchStr = "register_inst\.write_t\(";
my $replaceStr = "model\.fc_block\.";
open(FILE,"temp.sv") ||... (2 Replies)
I have a function which does awk proceessing
sub mergeDescription {
system (q@awk -F'~' '
NR == FNR {
A = $1
B = $2
C = $0
next
}
{
n = split ( C, V, "~" )
if... (3 Replies)
I want to write a Perl script that manipulates multiple files. In the directory, I have files 250.*chr$.ped where * is from 1 to 1000 and $ is from 1-22 for a total of 22 x 10,000 = 22,000 files.
I want to write a script that only manipulates files 250.1chr*.ped where * is from 1 to 22.... (10 Replies)
Hi folks,
I have a input.file with the following contents:-
flor
geor
enta
vpal
domi
pegl
cars
mted
four
rose
annc
gabi
ward
dalv
elph
beac (8 Replies)
Hi all!
I have to write a perl script that gets trashholds from a file and match them with an output of a command.
The trashhold file looks like this:
"pl-it_prod.GW.Sync.reply.*" "500" "-1" "" ""
"pl-it_prod.A.*" "100" "-1" "" ""
"application.log" ... (29 Replies)
Hi,
Here is my problem.. i have 2 files (file1, file2).. i have wrote the last two lines and first 4 lines of "file2" into two different variables .. say..
my $firstrec = `head -4 $file2`;
my $lastrec = `tail -2 $file2`;
and i write the rest of the file2 to a tmpfile and cat it with head... (2 Replies)
Hi friends,
i am trying to print warning for partition size which exceed limit of 90%
& other are ok.
i m using below command which print partition which exceed 90%
# df -h | sort -k5 | head -1 | awk 'END{ print $1" :- Not Having more space on This Partition"}'
i want to print... (14 Replies)
Hi Folks,
I posted a few days ago, thanks for the responses. My original question was for renaming files of sort 3p2325294.dgn in a directory containing multiple files. I need to drop the first 2 characters and the last in a unix script using Perl. How does it differ from using the Unix... (1 Reply)