CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Advanced: To print the file in spool with the new format of input file also: Edit Log



skr302
Novice

Oct 14, 2015, 6:20 AM


Views: 9345
To print the file in spool with the new format of input file also

Hi,

I am totally new to Perl and this is my first post.

Currently i have a perl script which takes the files with a fixed format and prints it to restricted spools.

If the file name is not standard then it sends them to Unhandled folder.

Also, it uses the filename to determine the folder they go to.

Currenty it will process a sample file which is in standard format like:
ISSU------__DCR2?DC???_YYYYMMDD_HHMMSS_USER-ID---_nnnnnnnn.???
ISSU------__??????????_YYYYMMDD_HHMMSS_USER-ID---_nnnnnnnn.???

ISSU------ denotes - 4 character Issuer code

and the output .DAT and .RPT file will be generated in a particular folder like below:
ABC-_DCR2FDCGBP_20151014_093010_ABCFBTEST3_00000000.DAT
ABC-_DCR2FDCGBP_20151014_093010_ABCFBTEST3_00000000.RPT

Now, the requirement is to modify the perl script to take the file of the below format also in addition with the existing format:

ISSU------__CQB???_YYMMDD_HHMMSS_---.???
Name of a sample file:
ABC-_BOANZD_151013034247_589.TXT

Format is like:
==================
Issuer code - 4 characters
Underscore
Bank id - Always CQB ( 3 characters)
Currency code - for example AUD, NZD etc for autralian dollar, new zealand dollar etc
Underscore
Date - in YYMMDD format - 6 digit date
Time - in hhmmss format - 6 digit time
Underscore
File counter - 3 digits file counter or sequence
Dot
Extension - 3 digit (it should be TXT)

Can some please send me the modified code. I am attaching the current code


(This post was edited by skr302 on Oct 14, 2015, 6:42 AM)
Attachments: sample.pl.txt (9.44 KB)


Edit Log:
Post edited by skr302 (Novice) on Oct 14, 2015, 6:25 AM
Post edited by skr302 (Novice) on Oct 14, 2015, 6:42 AM
Post edited by skr302 (Novice) on Oct 14, 2015, 6:42 AM


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives