regex - How to convert LineFeed delimited file to one line using repl.bat -
for example:
i have set of strings:
aaaa~ bbbb~
expected:
aaaa~bbbb~
im using repl.bat find , replace tool impelemented in batch file follows:
for /f "tokens=2,3" %%a in ('type c:\user\delim.txt') ( copy "c:\user\linefeed\%%a" "c:\user\linefeed\%%a.in.tmp" /f "tokens=1,*" %%s in (findnreplace.txt) ( type "c:\user\linefeed\%%a.in.tmp" | c:\user\bat\repl.bat "%%s" "%%t" x > "c:\user\linefeed\%%a.out.tmp" move /y "c:\user\linefeed\%%a.out.tmp" "c:\user\linefeed\%%a.in.tmp" ) move "c:\user\linefeed\%%a.in.tmp" "c:\user\clientout\%%a" )
example contents of delim.txt
^(aaaaa.{5}).{4}(.*)$ $17777$2
^(aaaaa.{5}).{4}(.*)$ - find pattern starts aaaaa followed 5 chars , 4 succeeding characters
$17777$2 - match value replaced 7777
what equivalent value in regex in order convert line feed delimited single line?
i think m42 right:
how replacing linefeed nothing? ie. : replace \r ""; \r stands line break, \n or \r or \r\n.
if want linefeed character, \r only.
Comments
Post a Comment