Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  1. dswaff

    VBS Search and replace REGex

    Thank you very much for the example. Here is what I found. After reading the file I wasn't closing the file. Then I was trying to write back to the same file using fso.OpenTextFile(WScript.Arguments(0), 2, True,0).Write txtFile I believe that because I was not closing the file after reading...
  2. dswaff

    VBS Search and replace REGex

    Well the files are not empty. I have a 32kb and an 18kb file I am testing with that has data. These files I receive I have no control over. I just have to make them work. I did notice when I write back to the file is when I have a problem. Keep getting invalid procedure call on this line...
  3. dswaff

    VBS Search and replace REGex

    Drag and drop the txt file on to the script vbs. via: WScript.Arguments(0)
  4. dswaff

    VBS Search and replace REGex

    Sorry. That was left overs from what I was trying using a line by line read till end of stream. It got messy though. Anyway, ignore that. The line is question is strSource = fso.OpenTextFile(WScript.Arguments(0)).ReadAll Error: input past end of file code 800a003e Here is the original...
  5. dswaff

    VBS Search and replace REGex

    IM back. I keep running into EOF errors. I have tried diffrent ways, but it keeps messing up my file format. Any ideas. Dim mytextfile Dim newtext Set fso = CreateObject("Scripting.FileSystemObject") Dim myReplacer dim strSource Set myReplacer = New reHelper strSource = ReadEntireFile...
  6. dswaff

    VBS Search and replace REGex

    Ok, New problem. Any idea how to use regex in vbs to remove null char. Least thats how notepad++ shows them. See screenshot. http://files.engineering.com/getfile.aspx?folder=bbd30bd6-600c-469d-8805-48dbc0525b12&file=nullcharremove.PNG...
  7. dswaff

    Tab Spacing all messed up.

    Thanks All. You are correct. The screenshot has the wrong font type. My Mistake. Although it does look the same way using a Monospaced font. Strongm you are correct. "Balance SBCS characters and DBCS characters" seems to be the issue. Any Idea how to script turning that off. I can only find how...
  8. dswaff

    Tab Spacing all messed up.

    Just in case anyone is curious, the script in vb to create the word file and set the expanded spacing is as follows: Function ConvertTxtToWord(TxtFilePath) Dim objshell,ParentFolder,BaseName,wordapp,doc,WordFilePath,objDoc Dim objSelection Set objshell=...
  9. dswaff

    Tab Spacing all messed up.

    Here is a screenshot. I am thinking something is wrong with my install now as the setting dont save. I have to change them everytime. http://files.engineering.com/getfile.aspx?folder=41851edd-fb3f-45cf-a400-f17b5504e4fd&file=font_settings1.PNG...
  10. dswaff

    Tab Spacing all messed up.

    Ok I did the same thing no effect till I changed the other settings.....That is going to make me nutty. I appreciate all of your help and sticking with me through this.
  11. dswaff

    Tab Spacing all messed up.

    I would like to know why I have to change the extra settings and you do not. That seems most odd to me.
  12. dswaff

    Tab Spacing all messed up.

    Okay so I finally figured it out. I tried multiple editors. word, WPS,openoffice. All do the same thing. First of course select your monospaced font and text size. I then had to Go into font settings of the Office suite you decide to use. Turn off Font Kerning and change the font space setting...
  13. dswaff

    Tab Spacing all messed up.

    Sorry. Here is a sample of the file. The name and numbers have been changed to protect the innocent. :P...
  14. dswaff

    Tab Spacing all messed up.

    Yes Courier is a monospace font. However in windows word, it is monospace only in height for some reason, not width. I have tested a bunch of monospace fonts and they all have the same symptom. I found on stock exchange someone was having the same problem, but with a diffrent program...
  15. dswaff

    Tab Spacing all messed up.

    Ok, so turns out I made an assumption...and we all know what that does. I compared the text file hidden chars with the word file hidden chars. They are the same. There is no tab char, only spaces. So I have been researching MONOSPACE Fonts. Looks like they are not working correctly in word...
  16. dswaff

    Tab Spacing all messed up.

    I wanted to use word because that is what is on everyone desktop. This will not be for my use but our data clerks. Notepad and notepad++ dont recognize page breaks. Word does. I am up for suggestions. I did try mono space fonts. Doesn't fix it :( The text file come from an asa/400 with old line...
  17. dswaff

    Tab Spacing all messed up.

    I have a text file that I need some users to open in word. I created the file via VBScript. In notepad or notepad++ the file looks great. Open the same file in word and the tab spacing is all messed up. Some times items in a row are single tabbed, or triple tabbed. What can I do to make it...
  18. dswaff

    VBS Search and replace REGex

    Tried that. I just get error line 23. What Found I could do though, since writing it in notepad++, I can hold alt, type 012 release alt and it inserts Page break FF. I can then copy the pagebreak FF and paste it in quotes and it works ! I also now have it saving as DOC and I am working on...
  19. dswaff

    VBS Search and replace REGex

    Ok. So I think I need to set encoding on the file or something. Its just a text file. I tried chr(12) but it just shows chr(12) in notepad++ and word. No actual page break.
  20. dswaff

    VBS Search and replace REGex

    You guys have been great. StrongGM thank you for your example. The one piece I was missing was regex.multiline. The only problem I have now is inserting a page break. If I use regEx.Replace(fso.OpenTextFile(WScript.Arguments(0)).ReadAll, "ch(12)") instead of inserting the page break it...

Part and Inventory Search

Back
Top