There are many variations on this. Here's just one solution. Note, though, that you need to do these transformations in a Transformer stage; in server jobs a Sequential File stage accesses data in the text file, without modifying it. Version 6 will allow you to pass the data through a filter, such as a sed or awk script.
To get the four characters to the left of the first "]" character:
Right(Field(TheString, "]", 1, 1), 4)
To get the four characters to the immediate right of the first "]" character:
Left(Field(TheString, "]", 2, 1), 4)
Will you need to handle the case that there might not be a "]" character?
Easy question
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact: