ªð¦^¦Cªí ¤W¤@¥DÃD µo©«

¨Ï¥Î Line Input #1, mystr ¤¤¤å¦r·|Åܦ¨¶Ã½X,½Ð°Ý¦³¤èªk§JªA¶Ü?

¨Ï¥Î Line Input #1, mystr ¤¤¤å¦r·|Åܦ¨¶Ã½X,½Ð°Ý¦³¤èªk§JªA¶Ü?

½Ð°Ý¦U¦ì¦³¹J¨ì¹L³o¼Ëªº°ÝÃD¶Ü?

Open myfile For Input as #1
       Line input #1,  mystr
Close #1

­Y mystr ¦³¤¤¤å½X,³£·|Åܦ¨¤@³s¦êªº?¸¹,½Ð°Ý¥i¥H§JªA¶Ü?
V98

¦^´_ 13# GBKEE

ÁÂÁÂG¤jÀ°¦£
´ú¸ÕOK!
google¤@¤U getElementsByTagName

http://itgroup.blueshop.com.tw/ann71727/ann71727?n=convew&i=4629  
http://renren.it/a/w3school/htmldom/met_doc_getelementsbytagname.html

¦n²`¶ø~ÁÙ¬O¬Ý¤£À´
¥~¦æ  O_Q

TOP

¦^´_ 12# HSIEN6001
¸Õ¸Õ¬Ý

IE¤U¸üºô­¶.rar (93.79 KB)

TOP

¦^´_ 9# Hsieh
¦^´_ 10# GBKEE

¬d¤F«Ü¦h¬ÛÃö¸ê°T,¥\¤O¤Ó®t
¤@ª½µLªk¸Ñ¨M,¥u¦n³Â·Ðª©¤jÀ°§Ú¬Ý¬Ý

½Ð°Ý
¸Ó¦p¦ó³]©w,¤~¥i¥H±Æ¸Ñ¶Ã½X°ÝÃD

test.rar (56.17 KB)

TOP

¦^´_ 9# Hsieh

Hsieh ª©¥D§A¦n:

Excel¤¤ÁöµM¦³ .openastextstream(1, -1) ªº¥\¯à, ¦ý¬O¦n¹³¤£°_§@¥Î,ÁÙ¬O¥²¶·±q¨Ó·½ÀɮפU¤â,§Ú¦b VB ±N­ì¨Óªºµ{¦¡½X
Using out_sw As StreamWriter = New StreamWriter(type_f)
§ï¦¨³o¼Ë´N¥i¥H¤F
Using out_sw As StreamWriter = New StreamWriter(type_f, True, System.Text.Encoding.ASCII)
V98

TOP

Sub Ex()
    Application.DisplayAlerts = False
    With Workbooks.Open("D:\Test\¤å¥ó.txt") '¶}±Ò Unicode ®æ¦¡ÀÉ®×
            .SaveAs Filename:="D:\Test\Test.txt", FileFormat:=xlText
            '¥t¦s¬° ASCII ®æ¦¡ÀÉ®×
            .Close
    End With
    Application.DisplayAlerts = True
End Sub

TOP

¦^´_ 8# linshin1999
  1. Sub OpenTextFileTest()
  2.     Dim fs, f
  3.     Set fs = CreateObject("Scripting.FileSystemObject")
  4.     Set f = fs.getfile("C:\Users\Documents\testfile.txt") 'Unicode ®æ¦¡ÀÉ®×
  5.     Set ts = f.openastextstream(1, -1)
  6.     mystr = ts.readall 'Ū¨úUnicode ®æ¦¡ÀÉ®×
  7.     ts.Close
  8.     Set f = fs.getfile("C:\Users\Hsieh\Documents\testfile1.txt") 'ASCII ®æ¦¡ÀÉ®×
  9.     Set ts = f.openastextstream(2, 0)
  10.     ts.Write mystr '¼g¤JASCII ®æ¦¡ÀÉ®×
  11.     ts.Close
  12. End Sub
½Æ»s¥N½X
¾Ç®üµL²P_¤£®¢¤U°Ý

TOP

¥»©«³Ì«á¥Ñ linshin1999 ©ó 2011-3-19 23:16 ½s¿è

¦^´_ 6# Hsieh

HsiehªO¥D:

§Q¥Î Line Input # 滙¤JÀÉ®×,¬O¤£¬O¤Ó¦Ñ¦¡¤F,¥H«e¦n¹³¶Ã½X§xÂZ«Ü¦h¤H,±qOffice 2007 ¥H«á¦n¹³³Q§ïµ½¤F,¹³¥Î ActiveSheet.QueryTables.Add 滙¶i¨ÓªºÀÉ®×´N没°ÝÃD,·|¥Î Line input #, ¬O¦]¬°¨º¬O¤¤¶¡Àɪø«×¤£©T©w,¦Ó¥B¤£¬O­nª½±µ¥á¨ì Worksheet ¥h, ©Ò¥H¥Î Line input #, ¤£ª¾¹D¦³没¨ä¥L¤èªk¥i¥H滙¤JÀÉ®×(¹³Åª´`§ÇÀɨº¼Ë), ¦Ó¥B¥i¥H±µ¨ü UTF-8 ªº? ÁÂÁÂ!!
V98

TOP

¥»©«³Ì«á¥Ñ linshin1999 ©ó 2011-3-19 20:18 ½s¿è

¦^´_ 6# Hsieh
HsiehªO¥D§A¦n:

°ÝÃD¸Ñ¨M¤F,§ÚªºVB­ì©l³]©w¬O(UTF-8),ÁöµM³o¼Ë¥i¥H¦ý¬O¬O¤£¬O¨C¦¸³£­n°µ³o¼ËªºÂà´«©O?
¥t¥~¦b Line Input ³oÃä¸Ñ¨M¤F,¦ý¬O·|¦b滙¤JÀɮרºÃä·|¥X°ÝÃD,³oÃä¾A¦X¥Î(UTF-8),¤£µM·|¶Ã½X.¶×¤JÀɮתºµ{¦¡¦p¤U:

With ActiveSheet.QueryTables.Add(Connection:=input_file, Destination:=Range("$A$1"))
        .Name = "ªíÀY"
        .RefreshOnFileOpen = False
        .RefreshStyle = xlInsertDeleteCells
        .SaveData = True
        .AdjustColumnWidth = True
        .TextFilePlatform = 65001
        .TextFileStartRow = 1
        .TextFileParseType = xlFixedWidth
        .TextFileColumnDataTypes = Array(2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2)
        .TextFileFixedColumnWidths = Array(2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3)
        .TextFileTrailingMinusNumbers = True
        .Refresh BackgroundQuery:=False
End With

³o¤@¬qµ{¦¡±µ¨ü(UTF-8),¦ÓLine Input¨ºÃä«h±µ¨ü(ANSI)³Â·Ð§a,¤£¹LÁ`¬O§â°ÝÃD§ä¥X¨Ó¤F,ÁÂÁ§A!!

¥t¥~§A¬O§_ª¾¹DVB¥i¦³±±¨î¿é¥X½Xªº¤èªk¶Ü?ÁÂÁÂ!!
V98

TOP

¦^´_ 5# linshin1999


    test.gif
¾Ç®üµL²P_¤£®¢¤U°Ý

TOP

        ÀR«ä¦Û¦b : ¤H¥Í¨S¦³©Ò¦³Åv¡A¥u¦³¥Í©Rªº¨Ï¥ÎÅv¡C
ªð¦^¦Cªí ¤W¤@¥DÃD