0

I'm trying to get the classpath with maven to a file, using the command:

mvn dependency:build-classpath -Dmdep.ouputFile=test.txt

but the result is in one line separated with ';'. The problem is when I try to read the line with windows batch I'm not getting results because the line is larger than 8192 characters. can I get the results in multiple lines instead of one?
If there is a way to use /P as @Squashman suggested but getting the parts based on the delimiter it will be great, otherwise, I prefer to get the dependencies list as multiple lines by the maven command if there is any.

soninob
  • 428
  • 11
  • 22
  • I know we discussed reading files with lines longer then 8192 bytes on DosTips.com. I would assume it has been discussed on StackOverFlow as well. I will search for the answer, but I would suggest you search as well. – Squashman May 01 '18 at 17:01
  • Possible duplicate of [File rewriting: One line is greater than variable's max size. Workaround?](https://stackoverflow.com/questions/18091056/file-rewriting-one-line-is-greater-than-variables-max-size-workaround) – Squashman May 01 '18 at 17:10
  • And here is where we talked about it on [DosTips.com](https://www.dostips.com/forum/viewtopic.php?t=4945) – Squashman May 01 '18 at 17:11
  • @Squashman thanks for the suggestion. I edit the Q. – soninob May 02 '18 at 05:55

1 Answers1

0

Splitting up the long line in file test.txt is an easy to achieve task with using JREPL.BAT written by Dave Benham which is a batch file / JScript hybrid to run a regular expression replace on a file using JScript.

Download the ZIP file containing JREPL.BAT and extract this batch file into directory of your batch file. Add to your batch file the following lines to replace all semicolons in test.txt by carriage return + line-feed.

call "%~dp0jrepl.bat" ";" "\r\n" /XSEQ /F test.txt /O -
Mofi
  • 46,139
  • 17
  • 80
  • 143