Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to remove extra spaces, tab in a text file?
#1
Solved: 11 Years, 4 Months ago
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
    browser("SPLAT! A Terrestrial RF").Page("SPLAT! A Terrestrial RF").Link("GNU General Public License").Click
    else
    reporter.ReportEvent micDone,"Gne public license", "License page"
end if
Set oFSO=CreateObject("scripting.FileSystemObject")
Set oFile=oFSO.CreateTextFile("C:\temp\another.txt", 2, True)
sCont=browser("SPLAT! A Terrestrial RF").Page("The GNU General Public").Object.documentElement.innertext
ParseSpaces "sCont"
oFile.write sCont
oFile.close
Set oFile=nothing
Set oFSO=Nothing

--------------------

Code:
Function ParseSpaces(TextIn)
   ParseSpaces=Replace(TextIn, " ", "")
   While (Instr(ParseSpaces, " ")>0)
         ParseSpaces=Replace(ParseSpaces, " ","")
   Wend
   While (Instr(ParseSpaces,vbNewLine)>0)
       ParseSpaces=Replace(ParseSpaces, " ", "")
   Wend
   While (Instr(ParseSpaces, vbTab)>0)
       ParseSpaces=Replace(ParseSpaces, " ", "")
   Wend
   While (Instr(ParseSpaces, vbCr)>0)
       ParseSpaces=Replace(ParseSpaces, " ", "")
   Wend
End Function

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
Reply


Messages In This Thread
How to remove extra spaces, tab in a text file? - by kkishore12345 - 12-14-2008, 01:52 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  How to remove the spaces from a string Anand 7 29,411 08-12-2019, 04:47 PM
Last Post: sreekanthP
  How to remove text in the webedit silpavinod 3 13,767 07-12-2018, 11:08 AM
Last Post: vijaychourasiya0109@gmail.com
  Need to Validate Text filed is blank after clicking on the Text box balak89 3 4,893 09-13-2015, 12:06 AM
Last Post: ADITI1992
  How to retrieve specied string from text file nsuresh316 1 2,467 06-09-2015, 12:24 AM
Last Post: nsuresh316
  Reading and writing is the same text file poulomi21b 2 6,086 07-08-2014, 12:39 PM
Last Post: poulomi21b

Forum Jump:


Users browsing this thread: 3 Guest(s)