Concatenate echoed text with the results of a grep command?

May 28, 2008
5
0
I am attempting to move our group to TC9 from Cygwin UNIX on XP for our fairly hefty reporting requirements.

We found a set of UNIX commands fully ported to Windows that work well for our purposes, HOWEVER...

Frequently in our reporting we must concatenate echoed text with the results of an embedded grep command as shown below

UNIX command:
echo This file reports $(grep -c '<MerchantRecord action="Add">' CIS.xml) OPEN MerchantRecord tags >> CIS_Validate.txt

Resulting in:
This file reports 21622 OPEN MerchantRecord tags

Questions:
How do I achieve the same result when using the Windows-ported grep in TC9? What would that single line of code look like? Or, more precisely, how do we concatenate echoed text with the results of an embedded grep command as shown above from a batch file in TC9?
 
May 20, 2008
603
0
Sammamish, WA
How do I concatenate echoed text with the results of an embedded grep command?

> UNIX command:
> *echo This file reports $(grep -c '<MerchantRecord action="Add">' CIS.xml) OPEN MerchantRecord tags >> CIS_Validate.txt*
>
> Resulting in:
> This file reports 21622 OPEN MerchantRecord tags

D:\>echo This file reports %@execstr[myprog] OPEN MerchantRecord tags
This file reports 21622 OPEN MerchantRecord tags



--
Jim Cook
2008 Fridays: 4/4, 6/6, 8/8, 10/10, 12/12 and 5/9, 9/5, 7/11, 11/7.
Next year they're Saturday.
 
May 20, 2008
3,515
4
Elkridge, MD, USA
How do I concatenate echoed text with the results of an embedded grep command?

JP Software Forums" <neil@jpsoft.com>; "therealmikenelson wrote:
| I am attempting to move our group to TC9 from Cygwin UNIX on XP for
| our fairly hefty reporting requirements.
|
| We found a set of UNIX commands fully ported to Windows that work
| well for our purposes, HOWEVER...
|
| Frequently in our reporting we must concatenate echoed text with the
| results of an embedded grep command as shown below
|
| UNIX command:
| *echo This file reports $(grep -c '<MerchantRecord action="Add">'
| CIS.xml) OPEN MerchantRecord tags >> CIS_Validate.txt*
|
| Resulting in:
| This file reports 21622 OPEN MerchantRecord tags
|
| Questions:
| How do I achieve the same result when using the Windows-ported grep
| in TC9? What would that single line of code look like? Or, more
| precisely, how do we concatenate echoed text with the results of an
| embedded grep command as shown above from a batch file in TC9?

I would try

*echo This file reports %@execstr[(grep -c '<MerchantRecord action="Add">'
CIS.xml)] OPEN MerchantRecord tags >> CIS_Validate.txt*

(all on one line, of course).
--
HTH, Steve
 
Similar threads
Thread starter Title Forum Replies Date
S Concatenate all playlists into 1 file Support 22
B Can copy command concatenate multiple mp3 files Support 2
R Bug TPIPE's pdf to text conversions don't work Support 2
Joe Caverly Using TYPE with non-English text Support 22
M Goto fails when a text endtext block precedes the code Support 5
Joe Caverly No blank line in TEXT...ENDTEXT in a LIBRARY function Support 8
S INPUT fails if the entered text contains pair of square brackets Support 6
Alpengreis List command: text truncated in find box (german) Support 9
vefatica Text invisible in v25 Support 10
S How to? What's the maximum size of the thread text ? Support 5
E Text copy bug Support 1
S FFIND text that includes " Support 7
S Setting Tabs=Bottom makes text turn black Support 6
Joe Caverly Multiple Text Searches at once using FFIND or TPIPE Support 4
AndrewJ TakeCommand v23 + ANSI color sequences leads to black on black text Support 6
D Grabbing html text with @line Support 3
M TCC screen text bright colors not as bright in 24 as 23 Support 5
vefatica Find Files/Text dialog: does it work? Support 0
Alpengreis Installer: text is still truncated in german language Support 2
Peter Murschall IDE destroys Text on Ctrl-U/Ctrl-Shift-U Support 12
WinLanEm Read Cyrillic text from a file Support 12
Charles Dye OSD loses ampersands in text Support 2
R How to? Display text same as in CMD Support 14
Glenn Bowes Strange text at startup Support 5
M Fixed Cannot use the "Browse..." function in "Find files/text" dialogbox Support 2
Peter Murschall WAD FOR reads Text in ASCII !??!? Support 7
B Documentation Reference/Windows X64: Redundant text at the end Support 0
Joe Caverly LIST /T (search for Text) Support 2
nikbackm How to? Find duplicate lines in text file Support 0
J Input text converts to uppercase Support 1
T How to? Select and Delete text Support 6
vhodro How to? Select text Support 10
D Highlighted Text Color? Support 2
vefatica Fixed No text in List View! Support 4
D Removing text with TPIPE Support 2
Frank locked file after "text > ..." Support 3
Joe Caverly Copying text of MSGBOX Support 0
Stefano Piccardi TPIPE and word to text conversion Support 4
A How to? filter text stream with a regular expression Support 11
Charles Dye Text selection in Take Command tab window Support 13
rconn Full text instant email notification Support 31
WadeHatler Any way to restore the Text Based "Select File" Windows in TCC Support 2
Jay Sage Function to Return Selected Text Support 2
mdwyer @replace - global use in a text file Support 3
E Line break in msgbox text Support 3
D Force For to treat set of values as text, not files Support 3
L command grouping with TEXT...ENDTEXT Support 1
R Misalignment of text Support 2
Jay Sage How Can SENDMAIL Create Messages with Plain Text and HTML Support 2
dcantor Help text for Date Formats Support 0

Similar threads