2 posts in this topic
I have a script that takes a large excel file, pulls out and reorganizes certain information I need, and spits out a trimmed down csv file which I uses to upload the information on my website. Some of this information contains characters with accents or em dashes. By default it would create a csv file in ANSI which I then uploaded but had to tell my website import system it was windows-1252 in order for it to look correct.
This was all working fine except now I need to add in a non-breaking space and non-breaking hyphen into parts of my output. At first I tried using ChrW(0xA0) and ChrW(0x2011) as replacements. A quick test in the console looked correct, however opening the csv output in notepad++ showed the space correctly but a ? for the hyphen and the file was still encoded as ANSI. I tried to view it as UTF-8 instead but this just made the space appear as xAO and also other characters appeared that way like my em dashes appeared as x97 and another symbol as xA7 etc.
If I instead do a convert to UTF-8 from notepad++ then those problems go away except the hyphen still displays as ?. I then noticed on the page I linked for the non-breaking hyphen it lists the UTF-8 hex as 0xE2 0x80 0x91 (e28091). I was unsure how to enter this in autoit but several things i tried all failed to get the hyphen inserted.
I need a way to get both the space and hyphen added correctly as either ANSI or UTF-8, but if it is UTF-8 then I need a way to convert all of the other data I extracted from the excel file.
I've included a test excel file with a single line and test script to create a csv demonstrating the problem.
By Kevin Finnegan
Long time lurker and now forum poster! I'm writing a relatively simple backup script for my firm that automates the copy, compression and organization of Leaver's data on one of our secured NAS systems. I personally found the best method to do this so far was to use 7zG.exe (GUI version of 7Zip which can use command-line too) and it functions quite well!
I would like to retrieve more info on whether any warnings or errors happen in 7Zip during the backup, but I can't quite get my head around the syntax and switches for reading out, it seems any adjustment I make to the RunWait call's string seems to break the backup or give unexpected repercussions! Hopefully its something silly I'm doing as I don't code very often.
Here is the working version:
; Compress the directories one by one in the zip using the listfile.... Local $iPID = RunWait(@ScriptDir & "\bin\7zG.exe a -mx" & $compressionQuality & " -v" & $compressSplitFileSize & " -wc:\temp " _ & $backupToLocation & "\" & $userDirectory & ".7z @bin\listfile.txt -x@bin\excludefile.txt", "", @SW_SHOWDEFAULT, $STDOUT_CHILD) Ultimately I would love to switch entirely to 7za.exe (standalone) so that I can read the progress percentage, current file being uploaded and any warnings or errors could be processed and output to the AutoIT script's GUI I've created rather than jumping in and out of two applications per se.
I try to activate my opened excel file using this code :
#include <Excel.au3> $oExcel = _Excel_Open() $sCaption = $oExcel.Caption WinSetState($sCaption, "", @SW_MAXIMIZE) But when i edit cell in my excel file above code not working because it open new excel sheet.
Hi I have jus started using auto-it . Please correct me if I'm wrong.
I need to read data from an input in text box and search in excel file and return value in next column of matched cell on GUI.
I have written below code but i cannot use variable which has data stored. it works only when search string is hard coded.
Please help out.
Local $GuiMain = GUICreate("EXCEL TEST", 399, 180) ;creates main GUI
;~ Local $idOK = GUISetOnEvent($GUI_EVENT_CLOSE, "Close")
Local $iWidthCell = 70
Local $idLabel = GUICtrlCreateLabel("PART NUMBER", 10, 30, $iWidthCell,50)
Local $RUN_1 = GUICtrlCreateButton("OK", 70, 70, 85, 25)
Local $Input_1 = GUICtrlCreateInput("PART NUMBER", 100, 20, 120, 20)
Local $sMenutext = GUICtrlRead($Input_1, 1)
$MSG = GUIGetMsg()
Case $MSG = $GUI_EVENT_CLOSE
Case $MSG = $RUN_1
Local $oAppl = _Excel_Open()
Local $sFilePath1 = "D:\Anu_WorkFolder\Components.xlsx"
Local $oWorkbook = _Excel_BookOpen($oAppl, $sFilePath1, Default, Default, True)
Local $aResult = _Excel_RangeFind($oWorkbook, $sMenutext , Default, Default, $xlWhole)
How to Activate Opened Excel Windows Using Class not Tittle, Because Some time opened defferent excel that have different name.
I Tried with
Winactivate ("[CLASS:XLMAIN]") but not working