Forums
New posts
Search forums
Members
Current visitors
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Forums
Archive
Archive
Perl
Perl Misc
Create a script to manipulate a flat file
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
[QUOTE="mrbungle50, post: 4848665"] Hello all, I have a question about designing a script that does two things. My skills in script writing are limited so will need you to be patient please. I have a file downloaded to a server (Linux box) that contains set length data in it. for example name, phone_number, address, zip_code, balance this file is what goes into an application whcih then translates the data and uses it according to certain criteria set in the data in the file. What I need to achieve is..... I want to read the zip_code on one row and if the zip_code is (example)9000 I want to add a zone_code of (example)09 to the beginning of the phone_number section. The file is not delimited by commas etc, but mainly by character spacing. So if a row in the flat file reads the following: 987412wallabywayPerthWA9077000094730308JohnCitizen that would be account number, house No, street, suburb/city, state, zip code, leading 3 zeros, phone number, first name, last name. I want to check if the zip code is 9XXX then remove the last 2 leading zeros and insert the zone code in it's place. The reason for this to put it in context is in Australia we have telephone area codes that span different states. eg: 08 can be for south Australia and the northern territory. But they are on different time zones (only an hour) but if the company calling then customer calls outside of the hours they are liable for massive fines for doing so. hence why I need to configure by zip code. If you can find a script that would do this, I would be eternally grateful. Yours in hope Craig MrBungle50 [/QUOTE]
Verification
Post reply
Forums
Archive
Archive
Perl
Perl Misc
Create a script to manipulate a flat file
Top