Focal Point Banner


As of December 1, 2020, Focal Point is retired and repurposed as a reference repository. We value the wealth of knowledge that's been shared here over the years. You'll continue to have access to this treasure trove of knowledge, for search purposes only.

Join the TIBCO Community
TIBCO Community is a collaborative space for users to share knowledge and support one another in making the best use of TIBCO products and services. There are several TIBCO WebFOCUS resources in the community.

  • From the Home page, select Predict: WebFOCUS to view articles, questions, and trending articles.
  • Select Products from the top navigation bar, scroll, and then select the TIBCO WebFOCUS product page to view product overview, articles, and discussions.
  • Request access to the private WebFOCUS User Group (login required) to network with fellow members.

Former myibi community members should have received an email on 8/3/22 to activate their user accounts to join the community. Check your Spam folder for the email. Please get in touch with us at community@tibco.com for further assistance. Reference the community FAQ to learn more about the community.


Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED] Help reading specific lines in a file...

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] Help reading specific lines in a file...
 Login/Join
 
Gold member
posted
Hi all.

I have a file where I have saved ?FDT for several masters. I have something like this:

----------------------------------------------------------------------
FOCUS 7.1.1 10.22.41 10/24/2008 LINE 0

? FDT OFIGRUBD
0 DIRECTORY:OFIGRUBD ON 10/24/2008 AT 10.22.40
DATE/TIME OF LAST CHANGE: 10/23/2008 15.17.25

0 SEGNAME LENGTH PARENT START END PAGES LINKS TYPE

1 OFIGRUBD 37 1 3714 1388 3
2 DATOS2 57 1 2 5837 2123 2
3 DATOS3 54 1 3 3715 2005 2
UNIDAD 4 3694 111 NEW
UNINTER4 5 3697 210 NEW

I only need to extract the lines that have a number in the first position:

1 OFIGRUBD 37 1 3714 1388 3
2 DATOS2 57 1 2 5837 2123 2
3 DATOS3 54 1 3 3715 2005 2

I need something to tell webfocus that if the line begins with a number, then read it, and if not, read next line.

Since Webfocus doesnt have a function that tells me if the current "x" positions is a number or have chars... I dont know how to do it.

Some ideas?

This message has been edited. Last edited by: rubenibi,



____________________________________________
Ruben Rueda
Consultant
Information Builders Iberica

Web: http://www.eruben.biz

Prod: WF 5.3.4 @ Red Hat Enterprise Linux ES 3 (Taroon Update 6) w/Oracle 9i
Test: WF 5.3.3 @ SUN Solaris 7 w/Oracle 8i
 
Posts: 52 | Location: Madrid | Registered: July 18, 2005Report This Post
Virtuoso
posted Hide Post
Create a master file that has two fields.
One field should be actual a2 and format i2, the other field should be the rest of the line as a a80 field.
Then, run a report where the first field is greater than 0.
All records that do not have numbers in the first two positions will fail to convert and will thus not show in your report. All lines that have a 0 value will be filtered out because of the greater than 0 clause. So you'll only get the correct records as a result.

Hope this helps...


GamP

- Using AS 8.2.01 on Windows 10 - IE11.
in Focus since 1988
 
Posts: 1961 | Location: Netherlands | Registered: September 25, 2007Report This Post
Gold member
posted Hide Post
Hi GamP, thanks for your reply.

The problem is, that in this file, I will have several ?FDT information from several masters. Each ?FDT has information about the table, and for each ?FDT I need to perform some operations.

Doing what you told me, I'll have a report with all the lines that begins with a number greter than zero, but I wouldnt have a way to manipulate the records in function of the current ?FDT.



____________________________________________
Ruben Rueda
Consultant
Information Builders Iberica

Web: http://www.eruben.biz

Prod: WF 5.3.4 @ Red Hat Enterprise Linux ES 3 (Taroon Update 6) w/Oracle 9i
Test: WF 5.3.3 @ SUN Solaris 7 w/Oracle 8i
 
Posts: 52 | Location: Madrid | Registered: July 18, 2005Report This Post
Virtuoso
posted Hide Post
Ok, you have the output of all ? FDT's in this one file and you need to see only the segment lines ordered by the name of the masterfile.
Then, as I said, create a master, only now have the format of the first field not i2 but a2.
Then in a define find out if the line starts with a ? (it's in the first field). If so, then there is your master file name. If not then the previous mater file name is still valid.
Then create a second define that converts the first field to a number and filter on that converted field to be greater than 0.

Hope this helps...


GamP

- Using AS 8.2.01 on Windows 10 - IE11.
in Focus since 1988
 
Posts: 1961 | Location: Netherlands | Registered: September 25, 2007Report This Post
Expert
posted Hide Post
quote:
Consultant
Information Builders Iberica
Warms the heart to know that even IB consultants need help sometimes Wink

T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
 
Posts: 5694 | Location: United Kingdom | Registered: April 08, 2004Report This Post
Gold member
posted Hide Post
quote:
Originally posted by Tony A:
quote:
Consultant
Information Builders Iberica
Warms the heart to know that even IB consultants need help sometimes Wink

T


Hi Tony Smiler

Focal Point it's the best place to ask and learn. I don't post often, but I am always seeing topics, there's a lot of useful information here ^^

Returning to the topic, GamP, I did what you told me, and it just work. I tried also to make without the necesity of creating and using a master file, and also works, picking the references you commented, and it also works.

Thanks for iluminating me Smiler



____________________________________________
Ruben Rueda
Consultant
Information Builders Iberica

Web: http://www.eruben.biz

Prod: WF 5.3.4 @ Red Hat Enterprise Linux ES 3 (Taroon Update 6) w/Oracle 9i
Test: WF 5.3.3 @ SUN Solaris 7 w/Oracle 8i
 
Posts: 52 | Location: Madrid | Registered: July 18, 2005Report This Post
Virtuoso
posted Hide Post
Ruben,

No problem, glad to have been of help. It's always nice to know that a possible solution offered indeed works out.
Could you please add [SOLVED] to the subject of this topic?


GamP

- Using AS 8.2.01 on Windows 10 - IE11.
in Focus since 1988
 
Posts: 1961 | Location: Netherlands | Registered: September 25, 2007Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED] Help reading specific lines in a file...

Copyright © 1996-2020 Information Builders