Searching a String in a Textfile

SOV
Member Posts: 6
Hi there,
I am currently trying to search for a certain String in a Textfile. I never did that before since I am pretty new to Navision and my first idea was to read the File-Variable in a BigText-Variable and search inside of this BigText-Variable for the different positions of the string I am looking for. But this won't work because the STRPOS-function can't be used in combination with a BigText-Variable as it seems.
I searched this forum but could not find a fitting solution to my problem.
Do you have any suggestions on how to search for a certain String in a Textfile? As easy as possible ;-)
Thanks in advance,
SOV
I am currently trying to search for a certain String in a Textfile. I never did that before since I am pretty new to Navision and my first idea was to read the File-Variable in a BigText-Variable and search inside of this BigText-Variable for the different positions of the string I am looking for. But this won't work because the STRPOS-function can't be used in combination with a BigText-Variable as it seems.
I searched this forum but could not find a fitting solution to my problem.
Do you have any suggestions on how to search for a certain String in a Textfile? As easy as possible ;-)
Thanks in advance,
SOV
0
Answers
-
Oh and I need to check the Textfile line per line. I think this is achieved using:
FileVariable.TEXTMODE(TRUE);
Is that correct?0 -
I don't know how to do this for a whole file, but if you want to do it line by line, then you can read a line into a tect variable (with a limit of 1024 characters) and evaluate the textvariable. I believe the command is MyFile.READTEXT.0
-
Thanks for your answer.
I now tried it like this:
FileVariable.READ(Line_Variable);
since "FileVariable.READTEXT", as you suggested, unfortunately didn't work.
When I want to find e.g. the substring "codeunit" in a text-variable, then I thought one would do that like this:
IF LineVariable = '*@codeunit*' THEN ...
But that won't work. :-(
Could anyone tell me what would be the correct way to achieve this last point?
Cheers,
SOV0 -
Think I got it. At least I have found some new things to try.
Thanks for your help.
SOV0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions