ªð¦^¦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

HsiehªO¥D:

§Úªº¤å¦rÀɬO±qVB²£¥Í¥X¨Óªº,±q°O¨Æ¥»¤¤¥i¥H¬Ý¨ì§¹¾ãªº¤å¦rÀÉ,¦ý¬O±qExcelŪ¶i¨Ó¹J¨ì¤¤¤å¦r·|Åܦ¨¶Ã½X.

myinx = 0
Open muti_f For Input As #1
        Do Until EOF(1)
            Line Input #1, mystr
            myinx = myinx +1
            mylist(myinx) = mystr
            muti_count = muti_count + 1
        Loop
    Close #1

·|¬O³]©wªº°ÝÃD¶Ü?
V98

TOP

HsiehªO¥D§A¦n:

¤£ª¾¹DVB¤¤ªº½s½Xªº¤è¦¡¬°¦ó,¦ý¬O¦pªG¬OUnicodeªº¸Ü,¦p¦óÂà´«¦¨Ansi ©O?
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

¥»©«³Ì«á¥Ñ 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

¦^´_ 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

        ÀR«ä¦Û¦b : ¯à¥I¥X·R¤ß´N¬OºÖ¡A¯à®ø°£·Ð´o´N¬O¼z¡C
ªð¦^¦Cªí ¤W¤@¥DÃD