Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: Seeking an Enlightened Path (Parsing, Translating, Translocating)

by Roy Johnson (Monsignor)
on Mar 10, 2008 at 19:05 UTC ( [id://673313]=note: print w/replies, xml ) Need Help??


in reply to Seeking an Enlightened Path (Parsing, Translating, Translocating)

You have given an example that does not fully describe the problem. Do you have four fixed-length columns of data that you want to rearrange? Changing the order from 1234 to 3214?

Caution: Contents may have been coded under pressure.

Replies are listed 'Best First'.
Re^2: Seeking an Enlightened Path (Parsing, Translating, Translocating)
by nanotasher (Novice) on Mar 10, 2008 at 20:34 UTC

    Fair enough. Let me describe a little more.

    I have a fixed-length file. The length of each record should not change. I have a field definition table within Oracle that I can configure if input or output requirements change.

    The data within each field is alphanumeric. My post showed data that was numeric for one field, then alpha the next. That was confusing. Sorry. The fields can consist of any combination of letters, numbers or spaces (since everything will be left-padded).

    Since I have the field definitions, I know that characters 1-10 will be field 1 in the input, and that it has to map to field 4 in the output (same length). Field 2 in the input (let's say 6 characters) has to map to field 1 in the output. Field 3 in the input will actually have to switch values. It may be 10 characters long in input, but I have to match this value against a list of values (the key of a hash table) and have it be 4 characters in the output (the value of the same hash table).

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://673313]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others examining the Monastery: (4)
As of 2024-03-29 09:17 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found