Illegal Path Error

@Anil_G

I have printed the string :slight_smile:
image
for in_Config(“OutputFilePath”).ToString+now.Date.ToString(“dd-MMM-yyyy”)

I guess for 14-Jul-2023 there is line break

@marina.dutta

Try this, its work for me:
Path.Combine(in_Config("OutputFilePath").ToString,Now.ToString("dd-MMM-yyyy"),in_TransactionItem("SubscriptionID").ToString).ReplaceLineEndings("\")

@marina.dutta

Give this

Path.Combine(in_Config(“OutputFilePath”).ToString,Now.ToString(“dd-MMM-yyyy”),in_TransactionItem(“SubscriptionID”).ToString.ReplaceLineEndings(“”))

for in_Config(“OutputFilePath”).ToString+now.Date.ToString(“dd-MMM-yyyy”)

I guess for 14-Jul-2023 there is line break

@marina.dutta

Can you please try this and check

System.Text.RegularExpressions.Regex.Replace(Path.Combine(in_Config("OutputFilePath").ToString.Trim,now.ToString("dd-MMM-yyyy"),in_TransactionItem("SubscriptionID").ToString.Trim),"\r?\n","")

this will replace line breaks as well in whole path

and mostly line break is there before subscriptionID may be …the above should suffice for those

cheers

@marina.dutta

Print it in message box then send the image it would be better

@marina.dutta

If 14-Jul-2023 there is line break
then give below
Path.Combine(in_Config(“OutputFilePath”).ToString,Now.Date.ToString(“dd-MMM-
yyyy”).ReplaceLineEndings(“”))

@Anil_G

Thanks a lot.It worked