Filename Validation


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Filename Validation
# 1  
Old 03-08-2010
MySQL Filename Validation

Hi All,
We need to use & execute some several scripts before loading the data successfully using Informatica.
Can you help me the below scenario:
We will be receiving the files from different countries, and using ftp all the files will be placed onto the server. The file structure will be (.csv file which contains, file header, document header, line items)
Code:
2011032419004000_GB_004_FEED01_0001_001link002-accoounting file
2011032419000400_GB_005_FEED01_0002_001link002-reporting file

(Out of scope for some interfaces)
-The above filename specifies as Datetime in format YYYYMMDDH24MISS(Prod. date time of the file=2011032419004000)
- Next 2 letter specifes the country name(Eg:Great Britian=GB, it will change per country, IT-Italy)
-Alpha numberic Interface Id(004_FEED01)
-A run number(0001)(Sequential number)
-Next, Link code to link 2 files. The feeder systems will use link code like 001link002 and send the files.
Our requirement is:
1) Filename validation if it is successfuly, we need to execute step2, else notify the source system that file name is wrong.
2) If it's successful, again we need to check whether it is duplicate and we need to infrom to source system(country's feeders)
3)If it is unique, check whether the file is in sequence. If it is not in sequence, we need to raise the warning in the error table & continue the load.
4)If the file is in sequence, perform the priori check(wait till the arrival of cluster accounts file)
5) If priori check fails, load aborted,
6)If priori check successful, move the source file to landing pad directory
7) Read the source file and perfrom audit trail of the detail records(check whether line item total record count and balances matches with the document Header Record count & balances
8) check whether detailed records total record count and balances matches with the File Header Record Count & balances
9) If it matches, perfrom audit trail of line item total record count and ablances matches with File document Record count & balances. If it is not matched, notify the source system
10) Check the line item records total count and balances matches with document Header Record Count and balances.
11) If the line item records total record count and balances not matches with the document Header Record Count and balances, raise an appropriate error and log the error in the error table, and notify the source system & abort the load.
Please, give some ideas for implementing these scenarios using scripts.

Thx
# 2  
Old 03-09-2010
You could use awk and especially it's substr function.
# 3  
Old 03-09-2010
Hi zaxxon,
Thanks for the idea. If possible, Can i have the script for the above scenario's please.
Thx
# 4  
Old 03-11-2010
This is a good topic, we'd like to help.

But before we do all works for you, can you please show us what you have done?
# 5  
Old 03-22-2010
Hi All,
Can you please, help me out for the above scenario. If possible, provide any script for the above scenario.
# 6  
Old 03-22-2010
Good scenarios posted by psr2009 but we do not write the entire script with the above resuirements, it would be possible through step by step.

As I feel with the above steps it is not only script but you may need to look from the Informatica (your integration part) level as well.
kandi.reddy
# 7  
Old 04-23-2010
Hi All,
It's right. I have the whole idea on the Informatica also. We can do some of the steps through Informatica without using Unix as well. We have done some POC stuff regarding this through Informatica already, it went well. My approach is do we get enough scripts for all the steps or not. Even some step by step is also can be done by some simple scripts also. If you can share these scripts, it will be helpful for me.

Thx
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

[Beginner's questions] Filename Validation & Parsing

Hi !! I'm rather new both to the UNIX and scripting worlds, and I'm learning the ropes of scripting. Having said this, please excuse me if you notice certain basic errors. I'm working on a script that implements .jar and .war files for a WAS environment and I need to perform certain... (4 Replies)
Discussion started by: levaldez
4 Replies

2. Programming

to extract all the part of the filename before a particular word in the filename

Hi All, Thanks in Advance I am working on a shell script. I need some assistance. My code: if then set "subscriber" "promplan" "mapping" "dedicatedaccount" "faflistSub" "faflistAcc" "accumulator"\ "pam_account"; for i in 1 2 3 4 5 6 7 8;... (0 Replies)
Discussion started by: aealexanderraj
0 Replies

3. UNIX for Dummies Questions & Answers

to extract all the part of the filename before a particular word in the filename

Hi All, Thanks in Advance I am working on a shell script. I need some assistance. My Requirement: 1) There are some set of files in a directory like given below OTP_UFSC_20120530000000_acc.csv OTP_UFSC_20120530000000_faf.csv OTP_UFSC_20120530000000_prom.csv... (0 Replies)
Discussion started by: aealexanderraj
0 Replies

4. Shell Programming and Scripting

Name validation

Hi All, I need to write a small piece of code to check the following. name should contain (A-Z), spaces, hyphens & apostrophes I need to generate regular expressions for the same. Please help me out as i am not familiar with regular expressions. (1 Reply)
Discussion started by: lifzgud
1 Replies

5. Shell Programming and Scripting

Filename from splitting files to have the same filename of the original file with counter value

Hi all, I have a list of xml file. I need to split the files to a different files when see the <ko> tag. The list of filename are B20090908.1100-20090908.1200_CDMA=1,NO=2,SITE=3.xml B20090908.1200-20090908.1300_CDMA=1,NO=2,SITE=3.xml B20090908.1300-20090908.1400_CDMA=1,NO=2,SITE=3.xml ... (3 Replies)
Discussion started by: natalie23
3 Replies

6. Shell Programming and Scripting

rename multiple filename.45267.txt to >> filename.txt

i have several thousand files and in subdirs that are named file.46634.txt budget.75346.pdf etc i want to remove the number but retain the extension. it is always a 5 digit. thanks. (6 Replies)
Discussion started by: jason7
6 Replies

7. Shell Programming and Scripting

gzcat into awk and then change FILENAME and process new FILENAME

I am trying to write a script that prompts users for date and time, then process the gzip file into awk. During the ksh part of the script another file is created and needs to be processed with a different set of pattern matches then I need to combine the two in the end. I'm stuck at the part... (6 Replies)
Discussion started by: timj123
6 Replies

8. UNIX for Dummies Questions & Answers

shortcut for tar cvf - [filename] | gzip > [filename].tar.gz

i'd like to have an alias (or something similar) where i can type a command like "archive" and a filename and have it tar and gzip the file, so... $ archive filename results in filename.tar.gz...do i have to write a script to do this? (4 Replies)
Discussion started by: bcamp1973
4 Replies

9. Shell Programming and Scripting

validation :file <filename>

My user is ftp a CSV file from window. There is possiblity to doing FTP through different mode. This file is then picked by another program, but I want to make sure the FTP file would be always ascii format, bu releasing a commaon File <file name> Can any one provide input , abut how to put a... (2 Replies)
Discussion started by: u263066
2 Replies

10. UNIX for Advanced & Expert Users

Filename Validation

I'm going through a script someone wrote and has left the company. I've a file_name -> s31-d173-lookup-20060502111140-sr In the ksh this is a validation : if |)-(*)-(*)---(|-)-sr)) ]]; The validation for the above file_name fails. Any idea why and what is file naming convention the... (2 Replies)
Discussion started by: F-1
2 Replies
Login or Register to Ask a Question