I am working with the Informatica platform that only allows me to use batch files. I am currently producing a list of file names with the command
dir /b /a-d
850_B_4545703_.txt
850_B_003029660_.txt
850_B_069029548_.txt
850_B_188789_.txt
850_C_ENT_1712865_.txt
850_C_ENT_1712871_.txt
850_C_1712877_.txt
But for Informatica to use this list to locate files I have to add path used in the flat file connection which is
\\jdeappp03\EDI\
So what I am trying to achieve is a batch file that will output the following:
\\jdeappp03\EDI\850_B_4545703_.txt
\\jdeappp03\EDI\850_B_003029660_.txt
\\jdeappp03\EDI\850_B_069029548_.txt
\\jdeappp03\EDI\850_B_188789_.txt
\\jdeappp03\EDI\850_C_ENT_1712865_.txt
\\jdeappp03\EDI\850_C_ENT_1712871_.txt
\\jdeappp03\EDI\850_C_1712877_.txt
I tried using dir /s/b *.txt but this give the absolute path which my setup of Informatica is not able to use to find the files.
Is there a way to get my desired result with a batch file?
dir -attributes !directory | % { write-output ('\\blah\blah\' + $_.name) }or slightly simpler if adequatedir *.txt | % ...or in CMDpowershell -c "{same}". (Powershelldiris actually an alias forget-childitemor its short formgci, which you can use if you wish. Similarly%isforeach-object.) – dave_thompson_085 Feb 09 '23 at 01:22dir *.txt | %" Doingdir *.txt | %gives "'%' is not recognized as an internal or external command" – barlop Feb 09 '23 at 08:05dir *.txt | % ...where...is a special written form called an elllipsis that in this case means "fill out the same (command) string from the previous example, which is long enough I didn't want to waste space and effort repeating it" -- although this explanation has now wasted more space and effort than the ellipsis saved. – dave_thompson_085 Feb 09 '23 at 10:27