04-08-2009
standard key holding mechanism:
Code :
#!/usr/local/bin/perl
$fin = "c";
unless ( open FIN, $fin ){
print "cannot read file $fin \n";
exit(9);
}
@a_lines = <FIN>; chomp @a_lines; close FIN;
$prev_customer = "ZZZZ";
foreach $line ( @a_lines ){
( $customer, @a_junk ) = split( / /, $line );
if ( $prev_customer ne $customer ){
if ( $prev_customer ne "ZZZZ" ){
print "\n";
}
$prev_customer = $customer;
print "$customer\n";
}
print join ' ', @a_junk;
print "\n";
}
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I am trying to write an awk program to reformat a data table and convert the date to julian time. I have all the individual steps working, but I am having some issues joing them into one program. Can anyone help me out? Here is my code so far:
# This is an awk program to convert the dates from... (4 Replies)
Discussion started by: climbak
4 Replies
2. Shell Programming and Scripting
Can anyone help me with a shell script that can do the following:
I have a data in fasta format (first line is the header, followed by a sequence of characters).
>ALLLY
GGCCCCTCGAGCCTCGAACCGGAACCTCCAAATCCGAGACGCTCTGCTTATGAGGACCTC
GAAATATGCCGGCCAGTGAAAAAATCTTGTGGCTTTGAGGGCTTTTGGTTGGCCAGGGGC... (5 Replies)
Discussion started by: manishabh
5 Replies
3. Shell Programming and Scripting
I have a file which have data like
A.txt
a
1Jan I am in a1.
1Jan I was born.
2Jan I am here.
3Jan I am in a3.
b
1Jan I am in b1.
c
2Jan I am in c2.
d
2Jan I am in d2.
5jan I am in d5.
date in the file might be vary evertime. (9 Replies)
Discussion started by: samkhu
9 Replies
4. Shell Programming and Scripting
Hi,
I am writing just to share my appreciation for help I have received from this site in the past.
In a previous post Split File by Data Group I received a lot of help with a troublesome awk script to reformat some complicated data blocks. What I learned really came in hand recently when I... (1 Reply)
Discussion started by: mkastin
1 Replies
5. Shell Programming and Scripting
input file:
hsa-miR-4726-5p
Score
hsa-miR-483-5p
Score
hsa-miR-125b-2*
Score
hsa-miR-4492
hsa-miR-4508
hsa-miR-4486
Score
Desired output file:
hsa-miR-4726-5p Score hsa-miR-483-5p Score hsa-miR-125b-2* Score hsa-miR-4492 hsa-miR-4508 hsa-miR-4486 Score ... (6 Replies)
Discussion started by: perl_beginner
6 Replies
6. Shell Programming and Scripting
Input file:
58227131
50087390
57339526
40578034
65348841
55614853
64363217
44178559
Desired output file:
58227131 50087390
57339526 40578034
65348841 55614853
64363217 44178559
Command that I try: (4 Replies)
Discussion started by: perl_beginner
4 Replies
7. Shell Programming and Scripting
I am helping my wife set up a real estate site and I am starting to integrate MLS listings. We are using a HostGator level 5 VPS running CentOS and have full root and SSH access to the VPS.
Thus far I have automated the daily FTP download of listings from our MLS server using a little sh script.... (4 Replies)
Discussion started by: Chicago_Realtor
4 Replies
8. Shell Programming and Scripting
Input file:
dependent general_process
dependent general_process
regulation general_process
- -
template component
food component
binding data_rearrangement
binding data_rearrangement
specific_activity data_rearrangement
- ... (7 Replies)
Discussion started by: cpp_beginner
7 Replies
9. Shell Programming and Scripting
Input file:
bv|111259484|pir||T49736_real_data
bv|159484|pir||T9736_data_figure
bv|113584|prf|T4736|truth
bv|113584|pir||T4736_truth
Desired output:
bv|111259484|pir|T49736|real_data
bv|159484|pir|T9736|data_figure
bv|113584|prf|T4736|truth
bv|113584|pir|T4736|truth
Once the... (8 Replies)
Discussion started by: perl_beginner
8 Replies
10. Shell Programming and Scripting
Input file
4CL1 O24145 CoA1
4CL1 P31684 CoA1
4CL1 Q54P77 CoA_1
73 O36421 Unknown
4CL3 Q9S777 coumarate
4CL3 Q54P79 coumarate
4CL3 QP7932 coumarate
Desired output result
4CL1 O24145#P31684 CoA1
4CL1 Q54P77 CoA_1
73 O36421 Unknown
4CL3 Q9S777#Q54P79#QP7932 coumarate
I... (5 Replies)
Discussion started by: perl_beginner
5 Replies
wxIcon(3erl) Erlang Module Definition wxIcon(3erl)
NAME
wxIcon - See external documentation: wxIcon.
DESCRIPTION
See external documentation: wxIcon .
This class is derived (and can use functions) from:
wxBitmap
DATA TYPES
wxIcon() :
An object reference, The representation is internal and can be changed without notice. It can't be used for comparsion stored on disc
or distributed for use on other nodes.
EXPORTS
new() -> wxIcon()
See external documentation .
new(X::string() | term()) -> wxIcon()
See external documentation .
Alternatives:
new(Filename::string()) -> new(Filename, [])
new(Loc::wx:wx()) -> wxIcon()
new(Filename::string(), Options::[Option]) -> wxIcon()
Types Option = {type, WxBitmapType} | {desiredWidth, integer()} | {desiredHeight, integer()}
WxBitmapType = integer()
See external documentation .
WxBitmapType is one of ?wxBITMAP_TYPE_INVALID | ?wxBITMAP_TYPE_BMP | ?wxBITMAP_TYPE_BMP_RESOURCE | ?wxBITMAP_TYPE_RESOURCE |
?wxBITMAP_TYPE_ICO | ?wxBITMAP_TYPE_ICO_RESOURCE | ?wxBITMAP_TYPE_CUR | ?wxBITMAP_TYPE_CUR_RESOURCE | ?wxBITMAP_TYPE_XBM |
?wxBITMAP_TYPE_XBM_DATA | ?wxBITMAP_TYPE_XPM | ?wxBITMAP_TYPE_XPM_DATA | ?wxBITMAP_TYPE_TIF | ?wxBITMAP_TYPE_TIF_RESOURCE |
?wxBITMAP_TYPE_GIF | ?wxBITMAP_TYPE_GIF_RESOURCE | ?wxBITMAP_TYPE_PNG | ?wxBITMAP_TYPE_PNG_RESOURCE | ?wxBITMAP_TYPE_JPEG |
?wxBITMAP_TYPE_JPEG_RESOURCE | ?wxBITMAP_TYPE_PNM | ?wxBITMAP_TYPE_PNM_RESOURCE | ?wxBITMAP_TYPE_PCX | ?wxBITMAP_TYPE_PCX_RESOURCE |
?wxBITMAP_TYPE_PICT | ?wxBITMAP_TYPE_PICT_RESOURCE | ?wxBITMAP_TYPE_ICON | ?wxBITMAP_TYPE_ICON_RESOURCE | ?wxBITMAP_TYPE_ANI |
?wxBITMAP_TYPE_IFF | ?wxBITMAP_TYPE_TGA | ?wxBITMAP_TYPE_MACCURSOR | ?wxBITMAP_TYPE_MACCURSOR_RESOURCE | ?wxBITMAP_TYPE_ANY
copyFromBitmap(This::wxIcon(), Bmp::wxBitmap() (see module wxBitmap)) -> ok
See external documentation .
destroy(This::wxIcon()) -> ok
Destroys this object, do not use object again
AUTHORS
<>
wxErlang 0.98.9 wxIcon(3erl)