Field Function
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 25
- Joined: Wed May 02, 2007 1:07 am
Field Function
Hi,
I have a requirement to separate out record which has a comma in it.
RECORD: rec1,rec2,rec3
the output I need be
rec1
rec2
rec3
I tried to read the RECORD using filed function as
Field(RECORD,',',1):CHAR(13):Field(RECORD,',',2):CHAR(13):Field(RECORD,',',3)
And the server is LINUX
But, I am unable to satisfy this requirement. Am I doing wrong here?
Can you please suggest on this.
Regards,
Kiran Kumar
I have a requirement to separate out record which has a comma in it.
RECORD: rec1,rec2,rec3
the output I need be
rec1
rec2
rec3
I tried to read the RECORD using filed function as
Field(RECORD,',',1):CHAR(13):Field(RECORD,',',2):CHAR(13):Field(RECORD,',',3)
And the server is LINUX
But, I am unable to satisfy this requirement. Am I doing wrong here?
Can you please suggest on this.
Regards,
Kiran Kumar
Re: Field Function
1) Are you trying to convert columns to rows?
2) In you example it is having 3 values (rec1,rec2,rec3). All the records are having 3 values or it varies!
2) In you example it is having 3 values (rec1,rec2,rec3). All the records are having 3 values or it varies!
Thanks
Ram
----------------------------------
Revealing your ignorance is fine, because you get a chance to learn.
Ram
----------------------------------
Revealing your ignorance is fine, because you get a chance to learn.
-
- Participant
- Posts: 25
- Joined: Wed May 02, 2007 1:07 am
Your Field() function call is syntactically correct. Is your target a sequential file? If so, then you need to use CHAR(10) as the record delimiter. If not, you need to give us a better explanation of exactly what it is you are trying to accomplish, i.e. what your requirement is.
Last edited by chulett on Wed May 23, 2012 8:03 pm, edited 1 time in total.
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
-
- Participant
- Posts: 25
- Joined: Wed May 02, 2007 1:07 am
Hi,
This actually worked with a Field function. there was some issue with the delimiter I'm passing in and I corrected it.
Now, I have another issue in-line with this.
the RECORD values varies and it has a comma as a delimiter as rec1,rec2,rec3,rec4.....and so on.
Can you please suggest how can i put this dynamic value into an order as:
rec1
rec2
rec3
rec4....
Can you please suggest.
Regards,
Kiran Kumar
This actually worked with a Field function. there was some issue with the delimiter I'm passing in and I corrected it.
Now, I have another issue in-line with this.
the RECORD values varies and it has a comma as a delimiter as rec1,rec2,rec3,rec4.....and so on.
Can you please suggest how can i put this dynamic value into an order as:
rec1
rec2
rec3
rec4....
Can you please suggest.
Regards,
Kiran Kumar
-
- Participant
- Posts: 25
- Joined: Wed May 02, 2007 1:07 am
My Target is an Oracle Database. Can i use Char(13)?chulett wrote:Your Field() function call is syntactically correct. Is your target a sequential file? If so, then you need to use CHAR(10) as the record delimiter. If not, you need to give us a better explanation of exactly what it is you are trying to accomplish, i.e. what your requirement is.
-
- Participant
- Posts: 25
- Joined: Wed May 02, 2007 1:07 am
-
- Participant
- Posts: 25
- Joined: Wed May 02, 2007 1:07 am