Compare file names and select correct elements to include in "for each loop"
Hi everyone,
I`ll try to be most clear I can explaining my help request.
I have 2 folders
Folder A-->This folder receives files through FTP constantly
Folder B-->The files from Folder A are unzipped and then processed in Folder B
Sometimes Folder A doesn`t contain all corresponding/relatives files in Folder B,
I mean, in certain moment only a new Computers.gz and a new Scanners.gz are present inFolder A and the other *.gz are not present, these correspond with Computers_Processed.txt and Scanners_Processed.txt. in Folder B. Something as follow:
Folder A
Folder B
--------------------------------------------
Cellphones_Processed.txt
Computers.gz
Computers_Processed.txt
Printers_Processed.txt
Scanners.gz
Scanners_Processed.txt
I have a long AWK routine (let say routine B) to process all text files (*.txt) in Folder B independently which
files are present in Folder A. something like this
#++ Routine B ++#
I would like to have a routine (let say routine A) that detects which filename.gz is present
in Folder A in a given moment and say over which filename_Processed.txt execute AWK routine.
I mean, routine A will get the list of elements for the selective "for each" loop.
# for this example elegible elements to fill the list are Computers_Processed.txt and Scanners_Processed.txt
#++ Routine A++# I imagine would be something like this: Then, comparing the name of files in folder A and B, how to get the correct list of elements to include in the "for each" statement?
Hello.
System : opensuse leap 42.3
I have a bash script that build a text file.
I would like the last command doing :
print_cmd -o page-left=43 -o page-right=22 -o page-top=28 -o page-bottom=43 -o font=LatinModernMono12:regular:9 some_file.txt
where :
print_cmd ::= some printing... (1 Reply)
I have a tar arcive
arch_all.tar.gz
and 4 batched tar archive . These batches are supposed to have all the files form arch1.all.tar.gz
arch1_batch1.tar.gz
arch1_batch2.tar.gz
arch1_batch3.tar.gz
arch1_batch4.tar.gz
my issue is that the directory structure in "arch_all.tar.gz" is... (6 Replies)
How to use "mailx" command to do e-mail reading the input file containing email address, where column 1 has name and column 2 containing “To” e-mail address
and column 3 contains “cc” e-mail address to include with same email.
Sample input file, email.txt
Below is an sample code where... (2 Replies)
Hi.
I've had a little mishap.
To cut a long story short, I've accidentally recursively ran chown on a directory (actually a bunch of 'em). Not a problem in itself, but I had a slight error in the code I used to get the list of directories and ended up with a comment in the file ownership.
... (15 Replies)
I want to be able to take a file name and then use sedto paste that text into the file.
I believe I know how to do the latter portion of pasting into the file at the location I want, but I do not know how to "copy" the file name to the "clipboard" for pasting.
Ideally I want to be able to... (1 Reply)
The "read" command, which is built into bash, takes words from the standard input. However, "read" is not good at taking file names if the file names contain spaces. I would like my bash script to ask the user to enter file names, which may contain spaces. Can you think about any technique for... (14 Replies)
Hi,
I have line in input file as below:
3G_CENTRAL;INDONESIA_(M)_TELKOMSEL;SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL
My expected output for line in the file must be :
"1-Radon1-cMOC_deg"|"LDIndex"|"3G_CENTRAL|INDONESIA_(M)_TELKOMSEL"|LAST|"SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL"
Can someone... (7 Replies)
Hi Everyone,
# cat a.txt
a;b;c;64O
a;b;c;d;ee;f
# cat a.pl
#!/usr/bin/perl
use strict;
use warnings;
my $tmp3 = ",,a,,b,,c,,d,,e,,f,,";
open(my $FA, "a.txt") or die "$!";
while(<$FA>) {
chomp;
my @tmp=split(/\;/, $_);
if ( ($tmp =~ m/^(64O)/i) || ($tmp... (3 Replies)
I am trying to use one global declaration --> "exec 2>$ERR" to capture all stderr outputs that may occur anywhere in my script.
Then close it at the end of the script using --> "exec 2<&-"
I am using KSH on Solaris 8.
KSH Version M-11/16/88i
If I comment two "exec .." statements in the... (11 Replies)
Haveing an issue. Anytime a file is created with "01" (zero one) in the name - it cannot be viewed by LS or any other file listing command. Although the file is there, it cannot be seen. I can edit it, run it, anything, except see it.....
What happened? Any ideas? (8 Replies)