Sponsored Content
Top Forums UNIX for Advanced & Expert Users selection of files based on its types Post 302164220 by ganapati on Monday 4th of February 2008 08:05:07 AM
Old 02-04-2008
Java selection of files based on its types

Daily we are getting some datafiles to our unix server location FTPIN.

Incoming File names will be present in the location "/xyz/test/" as below:

"infile_A1_YYYYMMDD",
"infile_A2_YYYYMMDD",
"infile_B1_YYYYMMDD",
"infile_C1_YYYYMMDD"
"infile_C2_YYYYMMDD"

Where A, B and C are the different file types with the number of files (1,2,3..) for that type.

There will be a file indicator for these file types either "Y" or "N" declared in
seperate file (PCP file) as below:

export A=Y
export B=N
export C=Y

Iam executing this PCP file to setup the values before running my script.

I've to create a script to select the files which has the file indicator as "Y"
for the files types A, B and C and extract the data records from these files to a single file.

My question is how to check the file indicator for these file types which is declared in some other script
through my script? Also how to select the files which has the file type as "Y"?


Please guide me...

With Regards / Mysore Ganapati
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

find directory with 2 types of files

Trying to use the find command to find any directory which contains a file ending in .zip AND a file ending in .o I'm having trouble specifying multiple files as criteria and have can't seem to figure it out from Unix in a Nutshell and Google. (2 Replies)
Discussion started by: dangral
2 Replies

2. Shell Programming and Scripting

Find duplicates from multuple files with 2 diff types of files

I need to compare 2 diff type of files and find out the duplicate after comparing each types of files: Type 1 file name is like: file1.abc (the extension abc could any 3 characters but I can narrow it down or hardcode for 10/15 combinations). The other file is file1.bcd01abc (the extension... (2 Replies)
Discussion started by: ricky007
2 Replies

3. Shell Programming and Scripting

selection of context in files

I have a file like this QUEUE: <ITEM(69)> "/NLA///ACHO_EQU_IDX" Q_KEY: <ITEM(69)> "/NLA///ACHO_EQU_IDX" Q_TYPE: <VSTR(32)> "GEN_VSTR_INDEX" ... (1 Reply)
Discussion started by: manas_ranjan
1 Replies

4. Shell Programming and Scripting

Help - Bug: A script to compile two types of data files into two temporary files

Dear other forum members, I'm writing a script for my homework, but I'm scratching all over my head and still can't figure out what I did wrong. Please help me. I just started to learn about bash scripting, and I appreciate if anyone of you can point out my errors. I thank you in advance. ... (3 Replies)
Discussion started by: ilove2smoke
3 Replies

5. Shell Programming and Scripting

Print selection of line based on line number

Hi Unix gurus Basically i am searching for the pattern and getting the line numbers of the grepped pattern. I am trying to print the series of lines from 7 lines before the grepped line number to the grepped line number. I am trying to use the following code. but it is not working. cat... (3 Replies)
Discussion started by: mohanm
3 Replies

6. UNIX for Dummies Questions & Answers

display types of files using metacharacters

1) I want to display all the files in a directory that start with the word chapter, are followed by a digit 1,2,6,8, or 9 and end with .eps or .prn so I came up with this file ~/temp/chapter.eps ~/temp/chapter.prn but is there a better way, i.e. combining both file types into the command? ... (2 Replies)
Discussion started by: dunsta
2 Replies

7. Shell Programming and Scripting

Remove two types of files from a directory

Hi All, i need to move two types of files from a directory. I have used the below command to find the files from the directory.. SOURCE_DIR="some directory path" TARGET_DIR="Target Dir" Datestamp=Date_format find $SOURCE_DIR \( -name "*.log" -o -name "*.out" ) - exec ls -1 {} \; now i... (9 Replies)
Discussion started by: ch33ry
9 Replies

8. Shell Programming and Scripting

Sed or awk : pattern selection based on special characters

Hello All, I am here again scratching my head on pattern selection with special characters. I have a large file having around 200 entries and i have to select a single line based on a pattern. I am able to do that: Code: cat mytest.txt | awk -F: '/myregex/ { print $2}' ... (6 Replies)
Discussion started by: usha rao
6 Replies

9. UNIX for Advanced & Expert Users

Recursive grep with only certain types of files

Can I please have some ideas on how to do a recursive grep with certain types of files? The file types I want to use are *.c and *.java. I know this normally works with all files. grep -riI 'scanner' /home/bob/ 2>/dev/null Just not sure how to get it to work *.c and *.java files. (5 Replies)
Discussion started by: cokedude
5 Replies

10. UNIX for Beginners Questions & Answers

Bash selection of files with similar name

Hi all, This is my first day on Linux shell!!! So, I am trying to write a script that that will pick up pairs of files with the same name (not the same content) but that are different in one character (one is *R1 the other is *R2)... Something like: look ate the files, whenever they are the... (3 Replies)
Discussion started by: ALou
3 Replies
inityp2l(1M)						  System Administration Commands					      inityp2l(1M)

NAME
inityp2l - create NIS (YP) to LDAP configuration files SYNOPSIS
/usr/lib/netsvc/yp/inityp2l [-m mapping_file_name] [-c config_file_name] DESCRIPTION
The inityp2l utility assists with creation of the NISLDAPmapping and ypserv files. See NISLDAPmapping(4) andypserv(4). inityp2l examines the NIS maps on a system. and through a dialogue with the user, determines which NIS to (and from) LDAP mappings are required. A NISLDAPmapping file is then created based on this information. The utility asks users about their LDAP server configuration and a ypserv file is created based on this information. The inityp2l utility handles mappings for standard NIS maps and the auto.* series of maps. If requested, it creates default mappings for custom maps, with each map entry represented as a single DIT string. inityp2l does not handle full custom mapping, but if requested, ini- typ2l will insert comments into the NISLDAPmapping file that indicate where these should be added. To write to the NISLDAPmapping or ypserv files is potentially dangerous. inityp2l warns the user and asks for confirmation before: 1. it overwrites either file 2. it writes to the default NISLDAPmapping file location, if this file did not previously exist. This is important because the existence of a file in this location causes NIS components to work NIS to LDAP (N2L) mode when next restarted, rather than to traditional NIS mode. inityp2l assists with rapid creation of a simple N2L configuration files. It is not a general purpose tool for the management of these files. An advanced user who would like to maintain the files or use custom mappings should examine the output of inityp2l and customize it by using a standard text editor. OPTIONS
inityp2l supports the following options: -c Specify the name of the generated ypserv file. The default location is described in FILES. -m Specify the name of the generated NISLDAPmapping file. The default is described in FILES. FILES
/var/yp The directory to be searched for candidate domains (/var/yp/*) and NIS maps (/var/yp/*/*) /var/yp/NISLDAPmapping The default location for the generated NISLDAPmapping file /etc/default/ypserv The default location for the generated ypserv file ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWypu | +-----------------------------+-----------------------------+ |Interface Stability |Obsolete | +-----------------------------+-----------------------------+ SEE ALSO
NISLDAPmapping(4), ypserv(4), attributes(5) SunOS 5.10 10 Apr 2003 inityp2l(1M)
All times are GMT -4. The time now is 05:41 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy