Page 1 of 1

How to increase Recursion Count of the Stack in a batch file

Posted: 22 Sep 2014 08:49
by hacker
Hi

****** B A T C H R E C U R S I O N exceeds STACK limits ******
Recursion Count=704, Stack Usage=90 percent
****** B A T C H PROCESSING IS A B O R T E D ******


How can increase Recursive Count of the Stack in a batch file?

Please Guide me in this regard.
Thanks in advance

Re: How to increase Recursion Count of the Stack in a batch

Posted: 22 Sep 2014 08:51
by Squashman
Dave has a good explanation of this over on SO.
http://stackoverflow.com/a/11917798/1417694

You may want to post your batch file.

Re: How to increase Recursion Count of the Stack in a batch

Posted: 22 Sep 2014 09:31
by jeb
Hi hacker,

you can't really expand the limit and the limit also depends of the windows version.

But you can change your recursion to an iteration, this will work as batch seems to be able to handle unlimited variables.
And I suppose it should be faster, as CALLs to functions are very slow.

You could post your code, so we are able to look for optimizations.

Re: How to increase Recursion Count of the Stack in a batch file

Posted: 30 Mar 2018 09:45
by ravikarthik
HI Team,
iam trying to convert the Tab delimited csv file into comma delimited csv file.Iam using the below code to do that.But i am getting the error as Batch recursion exceeds stock limits.

I have created batch file with the below script.

call jrepl "\t" "," /x /f "E:\Eapps\TEST1.csv" /o "E:\Eapps\TEST.csv"

Can anyone please help me here.

Re: How to increase Recursion Count of the Stack in a batch file

Posted: 30 Mar 2018 18:34
by ShadowThief
It should be as simple as

Code: Select all

@echo off
setlocal enabledelayedexpansion

for /f "delims=" %%A in (test1.csv) do (
	set "tab_line=%%A"
	set "comma_line=!tab_line:	=,!"
	echo !comma_line! >>test.csv
)

Re: How to increase Recursion Count of the Stack in a batch file

Posted: 31 Mar 2018 04:34
by Compo
Why not use the built in PowerShell CSV functionality:

Code: Select all

Import-Csv 'E:\Eapps\TEST1.csv' -Delimiter `t | Export-Csv 'E:\Eapps\TEST1.csv' -NoTypeInformation

Re: How to increase Recursion Count of the Stack in a batch file

Posted: 07 Apr 2018 00:58
by Rollon
jeb wrote:
22 Sep 2014 09:31
Hi hacker,

you test link can't really expand the limit and the limit also depends of the windows version.

But you can change your recursion to an iteration, this will work as batch seems to be able to handle unlimited variables.
And I suppose it should be faster, as CALLs to functions are very slow.

You could post your code, so we are able to look for optimizations.
Does this work well? It looks simple and straightforward.

Re: How to increase Recursion Count of the Stack in a batch file

Posted: 07 Apr 2018 09:35
by dbenham
ravikarthik wrote:
30 Mar 2018 09:45
But i am getting the error as Batch recursion exceeds stock limits.

I have created batch file with the below script.

call jrepl "\t" "," /x /f "E:\Eapps\TEST1.csv" /o "E:\Eapps\TEST.csv"

Can anyone please help me here.
JREPL.BAT alone cannot give you a recursion stack error. Either you have a corrupt version of JREPL.BAT, or the error has nothing to do with JREPL and there is more code that you are not showing.

The JREPL command you have shown should work fine, although the /X option is not needed.


Dave Benham