I am reading an Excel sheet then feeding the data table output into a write txt - however there are comas included. Is there a way I can remove the comas?
Would I use this in an assign?
Show us the data. If you are seeing commas it may be treating it as a CSV. Is the file .xlsx or .csv? Are you using Write Text or Write CSV?
Hi @E.T.S
You can use the data manipulation to achieve this.
Use the replace function to replace the comma(,) with a empty value.
Store the text in a String variable, let’s name the variable as InputStr.
InputStr.Replace(",","")
The above expression will replace the comma with Empty value.
If you want to remove the comma in the excel, use the find\replace value activity which is the modern excel activity.
Hope it helps!!
Thank you for your reply!
That didn’t work the txt file still had comas
Thank you for your reply!
I am using write text from an Excel file
Thank you for your reply!
There are no comas in the Excel
Hi @E.T.S
When you store the output in a variable it will be of type string. Use the below condition in assign activity:
str_Text= str_Text.Replace(",","")
This will replace the the ,
and store the output to the same variable. You can use that variable in further process.
Regards,
Can you explain your output is in which form like datatable or string format
Okay then use the below expression to remove the commas in the text.
InputStr.Replace(",","")
Hope you understand!!
Unfortunately that didn’t work, the txt file still had comas
if possible can you share the output of output datatable
Okay @E.T.S
The output datatable activity converts the datatable to String format.
You have used Write Text File activity to write the String data to the notepad file.
By using string data you can remove the comma symbol.
I’ve used this in the assign but the txt file still has comas :
for me its getting removed
or try this
outputstr=System.Text.RegularExpressions.Regex.Replace(inputstr,“,”,“”)
inputstr is the your input text
can you share the text
Hi @E.T.S ,
Could you provide us with the Sample Data and the Expected Output for it ? When replacing the Commas we might also lose some data representations or the actual value the data holds, So we would ask you provide us the Expected Representation and then we can provide more accurate suggestions on the same.