I have a .txt file and I want to keep from it only the lines that contain " Pc ".
Can you help me please?
3,0 770331208 500 Pc 418,60 1.883,70
Union flat seat Index 32,20
331 11/2. G Multi 13,00
4,0 770245235 100 Pc 642,20 577,98
Hexagon nipple, reducing Index 49,40
245 21/2.2. G Multi 13,00
Read text file, split the string output by Environment.newline,
iterate the array, use IF loop(item.contains(“Pc”)) Then store it in a collection/array or concat in string variable.
Can you try the following steps?
Read text file to string variable (let’s say strData) using Read Text File Activity.
Use Assign activity with the following expression
strData = String.Join(vbCrLf,strData.Split(vbcrlf.ToCharArray,StringSplitoptions.RemoveEmptyEntries).Where(function(x) x.Contains("Pc")))
Write strData to text file using Write Text File Activity if necessary.
Thank you very much for your contribution.
Your opinions helped me a lot!
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.