This snippet does the job well, (though there may already be a function in the bio-perl modules that addresses the wider issue you are solving, always worth having a look through CPAN before coding
This yields the following when called with the named files, the script could be "genericised" to deal with any number of files on the command line.
Last edited by Skrynesaver; 12-18-2011 at 08:22 AM..
Reason: Added example output
This User Gave Thanks to Skrynesaver For This Post:
Thanks for the reply Skrynesaver,
I tried your script (I named it "index?counts.pl") after making it executable, with the following command line:
Quote:
perl index_counts.pl <a.count <b.count >matrix
but I got the following error
Quote:
Modification of a read-only value attempted at index_counts.pl line 33.
which corresponds to:
Any idea about the error.
Does this script accepts mores than two input files?
Sorry for what might be basic questions, but I'm a really dummy in Perl.
Cheers!
---------- Post updated at 12:42 PM ---------- Previous update was at 12:37 PM ----------
Sorry only now I saw your command line,
but even so I get the following error trying the examples I gave
Quote:
perl index_counts.pl a.count b.count
Invalid input "CATG 10" in a.count, line 1
Invalid input "AATG 20" in a.count, line 2
Invalid input "AAAG 1" in a.count, line 3
Invalid input "AAAA 5" in a.count, line 4
Invalid input "CATG 100" in b.count, line 1
Invalid input "AATG 20" in b.count, line 2
Invalid input "AAAG 2" in b.count, line 3
Invalid input "CCCC 1000" in b.count, line 4
Modification of a read-only value attempted at index_counts.pl line 33.
---------- Post updated at 12:44 PM ---------- Previous update was at 12:42 PM ----------
I figured out, it was an extra space between collumns!
Thanks!
---------- Post updated at 01:16 PM ---------- Previous update was at 12:44 PM ----------
I tried to "genericised" the script for 3 input files:
the results are OK, the printed file is somehow deformated
Is there also any simpler way to increase input files, I have 50plus....
Hello Frens,
I am a newbie to shell scripting. I need a help on creating a for loop script (shell script) for removing files. I have a table called a_table with column name fil_name which contains all the files that need to be removed.
Thank you in advance (6 Replies)
I am required to create a CSV file reading last 200000 lines form a log file. I have to grep 3 parameters from this log file and write these parameters in the .csv file, with time stamp. This script will be setup in a cron job which will run every 10 minutes. I have written the script but it is... (5 Replies)
Gents,
Can you please help me to create a pivot table from a csv file. ( I have zip the csv file)
Using the file attached, columns 1,28 and 21 i would like to get something like this output
JD Val 1 2 3 4 5 6 7 8 9 10 11 12 Total... (4 Replies)
Hi Team,
I need to create a control file with a pre-defined structure for a given table name. The table is in teradata.
Ex: Table Name: TBL1
Table structure:
create multiset table tbl1, no fallback,
no before journal,
no after journal,
checksum = default,
default mergeblockratio... (7 Replies)
Hi, I am trying to make a command to delete my files out the trash can, but one at a time.
I am currently using rm - i to do this, but the original file locations for restoring my files are heard on a .txt file which I am using as an index table.
How would I manage to make it so that if I... (21 Replies)
I need a script that can do this:
A script that searches all directories and subdirectories for .html files
When a .html file is found it creates a index.html file in that folder.
It then edits the index.html file and inserts links to all of the .html files that are in that folder into the... (5 Replies)
hi there, I am trying to create a stored procedure that i can pass the table name to and it will create a table with that name. but for some reason it creates with what i have defined as the variable name . In the case of the example below it creates a table called 'tname'
for example
... (6 Replies)
Hi,
I have four input files and would like to create an output file as a table. Please check the example below.
File 1.
111111
222222
333333
444444
File 2.
555555
666666
777777
888888
File 3.
aaaaa
bbbbb
ccccc
ddddd (2 Replies)
why do inode indices starts from 1 unlike array indexes which starts from 0
its a question from "the design of unix operating system" of maurice j bach
id be glad if i get to know the answer quickly
:) (0 Replies)