How to remove extra spaces, tab in a text file? - Printable Version +- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums) +-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP) +--- Forum: UFT / QTP Beginners (https://www.learnqtp.com/forums/Forum-UFT-QTP-Beginners) +--- Thread: How to remove extra spaces, tab in a text file? (/Thread-How-to-remove-extra-spaces-tab-in-a-text-file) |
How to remove extra spaces, tab in a text file? - kkishore12345 - 12-14-2008 Hi there, Can one answer my below question please? I wrote one action and one function as follows. I have clicked associate this function to Action under File Menu Action: ----------- Code: If browser("SPLAT! A Terrestrial RF").Page("SPLAT! A Terrestrial RF").Link("NASA").Exist then -------------------- Code: Function ParseSpaces(TextIn) I am getting invalid parameters and sometime different error. What should I do apart from calling this function? Do I need to make any changes in the setting? I tried with ParseSpaces(sCont) also, no use. Please help, its very urgent. Thanks, kishore RE: How to remove extra spaces, tab in a text file? - surya_7mar - 12-14-2008 Code: ParseSpaces=Replace(ParseSpaces, chr(10),"") RE: How to remove extra spaces, tab in a text file? - kkishore12345 - 12-14-2008 surya_7mar Wrote:ParseSpaces=Replace(ParseSpaces, chr(10),"") Thanks for your reply Surya, I am able to remove couple of spaces, tabs. How can I remove any number of empty spaces in a line? say for example, I have the following string. Example:"Testing should be done everywhere. In the above line, after everywhere, rest of the line is blank. How can I remove these kinds of spaces? Thanks, kishore RE: How to remove extra spaces, tab in a text file? - sreekanth chilam - 12-14-2008 HI Kishore , For returning a string without Trailing & Leading Blank spaces can be done by using "Trim" built in function. ( i.e Rtrim,Ltrim,Trim) Code: str= " hai" ; ltrim(str) --> "hai" RE: How to remove extra spaces, tab in a text file? - surya_7mar - 12-16-2008 You can Use Trim () which will trim all the spaces RE: How to remove extra spaces, tab in a text file? - kkishore12345 - 01-04-2009 I used your answers and got the result. Thanks for the support! |