By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,353 Members | 1,555 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,353 IT Pros & Developers. It's quick & easy.

Data Parsing using existing data files in Perl

P: 1

I need Perl Script to do Data Parsing using existing data files.

I have my existing data files in the following directory:

Directory Name: workfs/ams
Data File Names: 20070504.dat, 20070503.dat, 20070502.dat

In each of above data files there will be some millions of records. So my job is read those data files and also read first 3 letters of each record in all above data files and write into new data files.For example

In 20070504.dat , first 3 letters of records will be PAS, PNE, or NSD I have to read first 3 letters and write a data file like bi+PAS.dat if it is PNE then bi+PNE.dat ...etc. So there will be no hard coding in script. It will be generic script.Basically what i have to do is read first 3 letters and keep it into variable and loop them.I am new to perl .Anybody can help me this please

May 5 '07 #1
Share this Question
Share on Google+
2 Replies

P: 41
U have to try something 1st and hit an issue then help will come in

your script sounds very simple
May 5 '07 #2

Expert 2.5K+
P: 4,059
Like tifoso said.... you start the code, we help, not the other way around. Look into using substr() or a regexp to read the first three characters in each record.
May 5 '07 #3

Post your reply

Sign in to post your reply or Sign up for a free account.