I'd like to pad the numbers at the beginning of a line with leading whitespace.
Code: Select all
4117:hea$der.log
307:inputfile.txt
307:inputfile2.txt
716:IP.bat
288:outputfile.txt
Can you please show an example of how I would get this, with a field width of 6 characters and the : replaced with a -
Code: Select all
4117-hea$der.log
307-inputfile.txt
307-inputfile2.txt
716-IP.bat
288-outputfile.txt
EDIT: I'm almost there. Just trying to find out how to add the minus sign
Code: Select all
echo 123:abc def|jrepl "(.*?):(.*)" "lpad($1,' ')+$2" /j
All Good!
Code: Select all
echo 123:abc def|jrepl "(.*?):(.*)" "lpad($1,' ')+'-'+$2" /j