------------------------------
Kimberly Crum
Rocket Forum Shared Account
------------------------------
------------------------------
Kimberly Crum
Rocket Forum Shared Account
------------------------------
The tab character is CHAR(9). You can get a section out of it with the
FIELD function i.e. FIELD1 = FIELD(LINE,CHAR(9), 1). You can also use the
CHANGE function to convert the line into a dynamic array and work with it
like normal:
LINE = CHANGE(LINE, CHAR(9), CHAR(254))
FIELD1 = LINE<1>
You might be able to use @AM in place of CHAR(254) depending on your MVDB
version.
Hope this helps.
Joe Goldthwaite
On Thu, Feb 2, 2023 at 10:23 AM Kimberly Crum via Rocket Forum <
Mail@forum.rocketsoftware.com> wrote:
> I am being asked to break a tab delimited file as part of an assessment.
> How do I identify the tab delimiter? ------------------------------...
> -posted to the "MultiValue Tools" forum
> Invite your colleagues to join the Rocket Forum and grow our expert
> network.
> ------------------------------
> [image: Rocket Software]
> MultiValue Tools
>
> Post New Message Online
>
> Invite your colleagues to join the Rocket Forum and grow our expert
> network. Share this link.
> Tab delimited file
>
> Reply to Group Online
>
> to Group
>
> [image: Kimberly Crum]
>
> Feb 2, 2023 12:24 PM
> Kimberly Crum
>
> I am being asked to break a tab delimited file as part of an assessment.
> How do I identify the tab delimiter?
>
> ------------------------------
> Kimberly Crum
> Rocket Forum Shared Account
> ------------------------------
> *Reply to Group Online
>
> *View Thread
>
> *Forward
>
> *Flag as Inappropriate
>
> *Post New Message Online
>
>
>
>
>
> You are subscribed to "MultiValue Tools" as joe@goldthwaites.com. To
> change your subscriptions, go to My Subscriptions
>
> To unsubscribe from this community discussion, go to Unsubscribe
>
> .
>
------------------------------
Kimberly Crum
Rocket Forum Shared Account
------------------------------
I appreciate your reply.
------------------------------
Kimberly Crum
Rocket Forum Shared Account
------------------------------
------------------------------
Kimberly Crum
Rocket Forum Shared Account
------------------------------
To add to previous responses. If the tab delimited file is Unix then your end-of-line character is CHAR(10). If the tab delimited file is Windows then your end-of-line if CHAR(13):CHAR(10). You may want to open the file in a HEX Editor to verify your data.
------------------------------
Peter Gonzalez
Programmer/Systems Analyst/EDI Developer
Self Registered
St. Louis MO US
------------------------------
------------------------------
Kimberly Crum
Rocket Forum Shared Account
------------------------------
Kimberly,
I'd add that if the file is line-delimited (e.g.)
abc <TAB> def <TAB> ghi <TAB> <END_OF_LINE>jkl <TAB> mno <TAB> pqr <TAB> <END_OF_LINE>stu <TAB> def <TAB> vwx<END_OF_LINE>
It is better to use OPENSEQ/READSEQ (to exhaustion)/CLOSESEQ to process the file line-by-line rather than READ and loop on FIELD for the whole file.
Regards
JJ
------------------------------
John Jenkins
Thame, Oxfordshire
------------------------------
Kimberly,
I'd add that if the file is line-delimited (e.g.)
abc <TAB> def <TAB> ghi <TAB> <END_OF_LINE>jkl <TAB> mno <TAB> pqr <TAB> <END_OF_LINE>stu <TAB> def <TAB> vwx<END_OF_LINE>
It is better to use OPENSEQ/READSEQ (to exhaustion)/CLOSESEQ to process the file line-by-line rather than READ and loop on FIELD for the whole file.
Regards
JJ
------------------------------
John Jenkins
Thame, Oxfordshire
------------------------------
I do this all the time.
My box has lots of RAM, so reading in a large file is easy.
READ record FROM F.FILE, XXX THEN
record = CHANGE(record, CHAR(10), "") ;* if on a UNIX box
record = CHANGE(record, CHAR(9), @VM)
AGAIN = @TRUE
LOOP
WHILE AGAIN
REMOVE ROW FROM record SETTING AGAIN
* Now, each "cell" is its own multi-value in ROW and can be accessed as:
* ROW<1,1>
* ROW<1,2>
* ect.
REPEAT
------------------------------
John Isael
Rocket Forum Shared Account
------------------------------
Sign up
Already have an account? Login
Welcome to the Rocket Forum!
Please log in or register:
Employee Login | Registration Member Login | RegistrationEnter your E-mail address. We'll send you an e-mail with instructions to reset your password.