Page 1 of 1
Macros: Multi-Find/Replace Problems
Posted: Fri May 17, 2002 5:54 pm
by S. Johnson
Hi all,
Background:
I've been trying to create a macro that will run over a raw EDI text file and strip out all the segments that I don't need, so that I can create a summary file for some end users.
Basically a modified version of the utility: EDI @
http://www.textpad.com/add-ons/files/utilities/edi.zip
Problem:
I finish recording the macro, which has 6 different Find/Replace calls and save it, but when I run it, it only executes the first Find/Replace call.
Additional Info:
I have tried recording the macro with all the Find/Replace calls done without closing the Find/Replace dialog box and also tried by opening & closing the Find/Replace dialog box after each Find/Replace call.
Any thought on why this is happening?
Thanks, in advance,
SJ.
Posted: Thu Nov 13, 2003 8:47 pm
by davidakoontz
Here's my notes from doing something like what you describe.
I'm using TextPad 4.7 (latest in Nov 03) - hope this helps!
-- snip --
TextPad(R) macro notes for ANSI_X12N_Reformat.TPM
This macro will indent the segments 4 spaces under the basic structure of the
ANSI 835 (Health Care Claim Payment/Advice version 004010X091).
The TextPad syntax file can also be used to highlight the segment names and
make the delimiters (*) fade into the background.
To recreate this marco one must follow this basic outline:
1) Open the 'Search' -> 'Replace' dialog box;
2) Start the recorder, using Ctrl+Shift+R, or the toolbar button;
3a) Type "~REF" (without the quotes) in the 'Find What' box;
3b) Type "~ REF" (without the quotes & 4 spaces) in the 'Replace With' box;
3c) Click the 'Replace All' button;
4) Repeat step 3 for each of the search/replace items below;
6) Stop the recorder, using Ctrl+Shift+R, or the toolbar button;
7) Save the macro with a suitable name.
Find What Replace With Notes
--------- ------------ -----------------------
Info in Claim & Service
~CAS ~ CAS the adjustments
~NM1 ~ NM1 names
~MIA ~ MIA adjudication
~MOA ~ MOA adjudication
~DTM ~ DTM date
~PER ~ PER contact
~REF ~ REF general reference
~AMT ~ AMT amount
~QTY ~ QTY quantity
~LQ ~ LQ remark codes
Info in Transaction Header
~BPR ~ BPR financial
~TRN ~ TRN trace
~CUR ~ CUR currency
Info in Payer/Payee ID (note I do not indent 'N1')
~N3 ~ N3 address
~N4 ~ N4 city state zip
Info in Detail Table
~TS2 ~ TS2 supplemental provider info
~TS3 ~ TS3 provider summary
~ ~\n Make this the LAST search/replace - check the 'Regular expression' condition
General Notes:
---------------
Assume: tilda '~' is the segment delimiter
I choose to use 4 spaces between the '~' and the segment ID (DTM) because this aligns the
indented segment ID after the delimiter (*) above the indented line.
The segments left at the margin are: ISA, GS, ST, N1, LX, CLP, SVC, PLB, SE, GE, IEA
This method could well be used for other ANSI formats - I'm only working with the 835 so
that is the one I know. Please feel free to extend this.
To undo this formating use ANSI_X12N_Unformat.TPM - a macro to remove the indends and
line breaks from the file.
Copyright (c) 2003 David A. Koontz
Licensed under the Open Software License version 2.0
Here's a link to my macros
Posted: Fri Nov 14, 2003 12:01 am
by davidakoontz
If you're doing Health Care - ANSI ASC X12N 835 - you might want to
take a look at these macros.
http://www.geocities.com/dakoontz/proje ... ities.html
It will do the search replace for the '~' and format the ANSI file with indents, along with a color syntax highlighting of segment names.
David