I have file name :
7. ABCD EFG 170223. txt
- under the condition
7. is static name
ABCD EFG 170223 is dynamic name
what if I want to read the filename “7.” only?
I have file name :
7. ABCD EFG 170223. txt
what if I want to read the filename “7.” only?
HI,
Do you mean you want to read files which name starts with “7.”?
If so, the following will work.
files = System.IO.Directory.GetFiles(System.Environment.CurrentDirectory,"7.*.*")
Regards,
Hi @samarasenja
How about this following:
1.Use the “Assign” activity to create a new string variable called fileName
.
2.Assign the file path to the fileName
variable.
3.Use the Path.GetFileNameWithoutExtension
method to get the file name without the extension.
4.Pass the fileName variable as an argument to this method.
5.Use Assign activity IsMatchVal
as a variable.
Assign fileName = "C:\Users\user\Documents\7. ABCD EFG 170223.txt"
Assign fileNameWithoutExtension = Path.GetFileNameWithoutExtension(fileName)
If activity IsMatchVal = System.Text.RegularExpressions.Regex.IsMatch(fileNameWithoutExtension ,"^7")
Regards
Gokul
What is Variable Types Files?
HI,
Can you try String array?
how about ABCD EFG 170223 Is dynamic Name?
Hi,
Can you try to set String at TypeArgument in ForEach activity?
Regards,
HI,
Also it’s necessary to set your target folder instead of System.Environment.CurrentDirectory, as the following.
System.IO.Directory("d:\DATA NOSTRO\PROCESSING DATA\17-19\Data","7.*.*")
Regards,
Not yet, sorry can you describe flow?
Hi, this is solved…
Thank you so much
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.