| 1 | package App::SeismicUnixGui::sunix::shell::cat_txt; | ||
| 2 | |||
| 3 | =head2 SYNOPSIS | ||
| 4 | |||
| 5 | PERL PROGRAM NAME: | ||
| 6 | |||
| 7 | AUTHOR: Juan Lorenzo (Perl module only) | ||
| 8 | |||
| 9 | DATE: | ||
| 10 | |||
| 11 | DESCRIPTION: | ||
| 12 | |||
| 13 | Version: | ||
| 14 | |||
| 15 | =head2 USE | ||
| 16 | |||
| 17 | =head3 NOTES | ||
| 18 | |||
| 19 | =head4 Examples | ||
| 20 | |||
| 21 | =head2 SYNOPSIS | ||
| 22 | |||
| 23 | =head3 SEISMIC UNIX NOTES | ||
| 24 | Usage for cat module in L_SU | ||
| 25 | |||
| 26 | cat derives from unix command of the same name | ||
| 27 | |||
| 28 | |||
| 29 | |||
| 30 | Added: by Juan Lorenzo Jan. 2022 | ||
| 31 | |||
| 32 | |||
| 33 | |||
| 34 | Usage: cat base_file_name1='sufile1' base_file_name2='sufile2' > output_file | ||
| 35 | |||
| 36 | |||
| 37 | |||
| 38 | base_file_name1=first (su file) | ||
| 39 | |||
| 40 | base_file_name2=second optional (su file) | ||
| 41 | |||
| 42 | output file is handled by module data_out.pm | ||
| 43 | |||
| 44 | =head2 User's notes (Juan Lorenzo) | ||
| 45 | untested | ||
| 46 | |||
| 47 | =cut | ||
| 48 | |||
| 49 | |||
| 50 | =head2 CHANGES and their DATES | ||
| 51 | |||
| 52 | =cut | ||
| 53 | |||
| 54 | use Moose; | ||
| 55 | our $VERSION = '0.0.1'; | ||
| 56 | |||
| 57 | my $path; | ||
| 58 | my $SeismicUnixGui; | ||
| 59 | use Shell qw(echo); | ||
| 60 | |||
| 61 | BEGIN { | ||
| 62 | |||
| 63 | $SeismicUnixGui = ` echo \$SeismicUnixGui`; | ||
| 64 | chomp $SeismicUnixGui; | ||
| 65 | $path = $SeismicUnixGui.'/'.'sunix/shell'; | ||
| 66 | |||
| 67 | } | ||
| 68 | #use lib "$path"; | ||
| 69 | extends 'App::SeismicUnixGui::sunix::shell::cat_su'; | ||
| 70 | |||
| 71 | #=head2 Import packages | ||
| 72 | # | ||
| 73 | #=cut | ||
| 74 | # | ||
| 75 | #use App::SeismicUnixGui::misc::L_SU_global_constants(); | ||
| 76 | # | ||
| 77 | #use App::SeismicUnixGui::misc::SeismicUnix qw($go $in $off $on $out $ps $to $suffix_ascii $suffix_bin $suffix_ps $suffix_segy $suffix_su); | ||
| 78 | #use App::SeismicUnixGui::configs::big_streams::Project_config; | ||
| 79 | # | ||
| 80 | # | ||
| 81 | #=head2 instantiation of packages | ||
| 82 | # | ||
| 83 | #=cut | ||
| 84 | # | ||
| 85 | #my $get = L_SU_global_constants->new(); | ||
| 86 | #my $Project = Project_config->new(); | ||
| 87 | #my $DATA_SEISMIC_SU = $Project->DATA_SEISMIC_SU(); | ||
| 88 | #my $DATA_SEISMIC_BIN = $Project->DATA_SEISMIC_BIN(); | ||
| 89 | #my $DATA_SEISMIC_TXT = $Project->DATA_SEISMIC_TXT(); | ||
| 90 | # | ||
| 91 | #my $PS_SEISMIC = $Project->PS_SEISMIC(); | ||
| 92 | # | ||
| 93 | #my $var = $get->var(); | ||
| 94 | #my $on = $var->{_on}; | ||
| 95 | #my $off = $var->{_off}; | ||
| 96 | #my $true = $var->{_true}; | ||
| 97 | #my $false = $var->{_false}; | ||
| 98 | #my $empty_string = $var->{_empty_string}; | ||
| 99 | # | ||
| 100 | #=head2 Encapsulated | ||
| 101 | #hash of private variables | ||
| 102 | # | ||
| 103 | #=cut | ||
| 104 | # | ||
| 105 | #my $cat_txt = { | ||
| 106 | # _base_file_name1 => '', | ||
| 107 | # _base_file_name2 => '', | ||
| 108 | # _Step => '', | ||
| 109 | # _note => '', | ||
| 110 | # | ||
| 111 | #}; | ||
| 112 | # | ||
| 113 | #=head2 sub Step | ||
| 114 | # | ||
| 115 | #collects switches and assembles bash instructions | ||
| 116 | #by adding the program name | ||
| 117 | # | ||
| 118 | #=cut | ||
| 119 | # | ||
| 120 | # sub Step { | ||
| 121 | # | ||
| 122 | # $cat_txt->{_Step} = 'cat'.$cat_txt->{_Step}; | ||
| 123 | # return ( $cat_txt->{_Step} ); | ||
| 124 | # | ||
| 125 | # } | ||
| 126 | # | ||
| 127 | # | ||
| 128 | #=head2 sub note | ||
| 129 | # | ||
| 130 | #collects switches and assembles bash instructions | ||
| 131 | #by adding the program name | ||
| 132 | # | ||
| 133 | #=cut | ||
| 134 | # | ||
| 135 | # sub note { | ||
| 136 | # | ||
| 137 | # $cat_txt->{_note} = 'cat'.$cat_txt->{_note}; | ||
| 138 | # return ( $cat_txt->{_note} ); | ||
| 139 | # | ||
| 140 | # } | ||
| 141 | # | ||
| 142 | # | ||
| 143 | #=head2 sub clear | ||
| 144 | # | ||
| 145 | #=cut | ||
| 146 | # | ||
| 147 | # sub clear { | ||
| 148 | # | ||
| 149 | # $cat_txt->{_base_file_name1} = ''; | ||
| 150 | # $cat_txt->{_base_file_name2} = ''; | ||
| 151 | # $cat_txt->{_Step} = ''; | ||
| 152 | # $cat_txt->{_note} = ''; | ||
| 153 | # } | ||
| 154 | # | ||
| 155 | # | ||
| 156 | #=head2 sub base_file_name1 | ||
| 157 | # | ||
| 158 | # | ||
| 159 | #=cut | ||
| 160 | # | ||
| 161 | # sub base_file_name1 { | ||
| 162 | # | ||
| 163 | # my ( $self,$base_file_name1 ) = @_; | ||
| 164 | # if ( $base_file_name1 ne $empty_string ) { | ||
| 165 | # | ||
| 166 | # $cat_txt->{_base_file_name1} = $base_file_name1; | ||
| 167 | # $cat_txt->{_note} = $cat_txt->{_note}.' '.$cat_txt->{_base_file_name1}; | ||
| 168 | # $cat_txt->{_Step} = $cat_txt->{_Step}.' '.$cat_txt->{_base_file_name1}; | ||
| 169 | # | ||
| 170 | # } else { | ||
| 171 | # print("cat_txt, base_file_name1, missing base_file_name1,\n"); | ||
| 172 | # } | ||
| 173 | # } | ||
| 174 | # | ||
| 175 | # | ||
| 176 | #=head2 sub base_file_name2 | ||
| 177 | # | ||
| 178 | # | ||
| 179 | #=cut | ||
| 180 | # | ||
| 181 | # sub base_file_name2 { | ||
| 182 | # | ||
| 183 | # my ( $self,$base_file_name2 ) = @_; | ||
| 184 | # if ( $base_file_name2 ne $empty_string ) { | ||
| 185 | # | ||
| 186 | # $cat_txt->{_base_file_name2} = $base_file_name2; | ||
| 187 | # $cat_txt->{_note} = $cat_txt->{_note}.' '.$cat_txt->{_base_file_name2}; | ||
| 188 | # $cat_txt->{_Step} = $cat_txt->{_Step}.' '.$cat_txt->{_base_file_name2}; | ||
| 189 | # | ||
| 190 | # } else { | ||
| 191 | # print("cat_txt, base_file_name2, missing base_file_name2,\n"); | ||
| 192 | # } | ||
| 193 | # } | ||
| 194 | # | ||
| 195 | # | ||
| 196 | #=head2 sub get_max_index | ||
| 197 | # | ||
| 198 | #max index = number of input variables -1 | ||
| 199 | # | ||
| 200 | #=cut | ||
| 201 | # | ||
| 202 | #sub get_max_index { | ||
| 203 | # my ($self) = @_; | ||
| 204 | # my $max_index = 1; | ||
| 205 | # | ||
| 206 | # return($max_index); | ||
| 207 | #} | ||
| 208 | |||
| 209 | |||
| 210 | 1; |