@@ -8,21 +8,21 @@ public class Concat : IUtil
88 {
99 public string Name => "concat" ;
1010 public string Info => "Concatenates text files." + Environment . NewLine +
11- "Args: not interactive (-ni), out-file (-out), files [separated by comma ] (-files) " +
11+ "Args: not interactive (-ni), out-file (-out), paths map file [separated by new line ] (-files) " +
1212 "new-line-separator (-fsep)" ;
1313
1414 public int Run ( RunArgs ra )
1515 {
1616 bool interactive = ! ra . InArgs . ContainsKey ( "-ni" ) ;
1717 var allText = string . Empty ;
1818 var outFile = string . Empty ;
19- var toBeJoined = string . Empty ;
19+ var fileMap = string . Empty ;
2020 var newLinefileSep = false ;
2121
2222 if ( interactive )
2323 {
2424 Utils . ReadString ( "Out file path: " , ref outFile , true ) ;
25- Utils . ReadString ( "The file paths separated by comma : " , ref toBeJoined , true ) ;
25+ Utils . ReadString ( "The file paths map : " , ref fileMap , true ) ;
2626
2727 var newLine = string . Empty ;
2828 Utils . ReadString ( "Add new line before each file? (y/*): " , ref newLine ) ;
@@ -33,14 +33,14 @@ public int Run(RunArgs ra)
3333 if ( ra . InArgs . ContainsKey ( "-out" ) ) outFile = ra . InArgs . GetFirstValue ( "-out" ) ;
3434 else throw new ArgumentNullException ( "-out" ) ;
3535
36- if ( ra . InArgs . ContainsKey ( "-files" ) ) toBeJoined = ra . InArgs . GetFirstValue ( "-files" ) ;
36+ if ( ra . InArgs . ContainsKey ( "-files" ) ) fileMap = ra . InArgs . GetFirstValue ( "-files" ) ;
3737 else throw new ArgumentNullException ( "-files" ) ;
3838
3939 if ( ra . InArgs . ContainsKey ( "-fsep" ) ) newLinefileSep = true ;
4040 }
4141
4242 var sb = new StringBuilder ( ) ;
43- var F = toBeJoined . Split ( FILE_SPLITTER ) ;
43+ var F = File . ReadAllLines ( fileMap ) ;
4444 var counter = 0 ;
4545
4646
0 commit comments