Author Topic: Macro Program to read/parse a text file for specific data  (Read 10820 times)

MikeFowler

  • New Community Member
  • Posts: 1
  • Hero Points: 0
Macro Program to read/parse a text file for specific data
« on: September 23, 2009, 09:37:45 PM »
I'm brand new to the forum and pretty new to the SlickEdit programming environment.
I have been asked to work on our SlickEdit version of the editor. We have written many
supporting macro programs written to handle various tasks. I want to prefill some dialog
text boxes with some data that is stored in an external text file.

My question: Can a Slick Edit macro program (ex: UserMod.e) open a standard Text File,
read it line by line, parsing for specific text, and once the text is located, read the data,
items of interest to several fields in a (soon to be displayed) dialog box?

The user wants several of the dialog's fields to be defaulted from data in the external text file?

Hopefully what I am trying to say is clear. Thank you.

chrisant

  • Senior Community Member
  • Posts: 1410
  • Hero Points: 131
Re: Macro Program to read/parse a text file for specific data
« Reply #1 on: September 23, 2009, 10:35:18 PM »
Yes, definitely, that is fairly straightforward how to do.

Some starting pointers:
See the _open_temp_view and _create_temp_view commands for creating a hidden buffer (into which you can load an external file and then use the editor primitives to get at the text, etc).
See the form editor, e.g. on the main menu use Macros|New Form... and read up on forms.

As you have specific questions, you can typically get help from other users via these forums, usually with <2 day turnaround (that's not a promise, of course ;)).

chrisant

  • Senior Community Member
  • Posts: 1410
  • Hero Points: 131
Re: Macro Program to read/parse a text file for specific data
« Reply #2 on: September 23, 2009, 10:39:18 PM »
Here are a couple links to sample macros that might be handy templates to learn from:
Sync_project_with_scm -- illustrates reading from an external file.
open_local_symbol -- illustrates a simple form (probably too simple for your purposes, but it should help introduce form concepts).

MindprisM

  • Senior Community Member
  • Posts: 127
  • Hero Points: 8
Re: Macro Program to read/parse a text file for specific data
« Reply #3 on: September 28, 2009, 07:39:22 AM »
See Macro to extract string list from file based on targets of a regex for utils to read file into array and regex extraction

rlaa

  • Community Member
  • Posts: 5
  • Hero Points: 0
Re: Macro Program to read/parse a text file for specific data
« Reply #4 on: October 26, 2009, 03:28:23 PM »
How to compile c code and see the results in the output window (WIN/XP) ?

I created a C file and added that file to the project.
Could somebody help me out to use slickedit tools to compile and see the results of the executable file.

Should I just compile or do both compile and build?

I have always used VS for just browsing the code. This is the first time I trying to use it to compile the code and run the executable.

Thanks in advance.

========= I am getting the following error==============
C:\vslick\win\samp-test1>echo VSLICKERRORPATH="c:\vslick\win\samp-test1"
VSLICKERRORPATH="c:\vslick\win\samp-test1"

C:\vslick\win\samp-test1>"C:\vslick\win\vsbuild" make "c:\vslick\win\samp-test1\samp-test1.vpw" "c:\vslick\win\samp-test1\samp-test1.vpj"
Cannot specify vsbuild as build tool without specifying an operation

C:\vslick\win\samp-test1>c: & cd c:\vslick\win\samp-test1

C:\vslick\win\samp-test1>echo VSLICKERRORPATH="c:\vslick\win\samp-test1"
VSLICKERRORPATH="c:\vslick\win\samp-test1"

C:\vslick\win\samp-test1>"C:\vslick\win\vsbuild" make "c:\vslick\win\samp-test1\samp-test1.vpw" "c:\vslick\win\samp-test1\samp-test1.vpj"
Cannot specify vsbuild as build tool without specifying an operation

C:\vslick\win\samp-test1>

chrisant

  • Senior Community Member
  • Posts: 1410
  • Hero Points: 131
Re: Macro Program to read/parse a text file for specific data
« Reply #5 on: October 26, 2009, 11:48:44 PM »
This question seems unrelated to the existing topic, I'd recommend starting a new topic to avoid confusion.