我市菜鸟 望大家帮帮忙
11 个解决方案
#1
在csdn或者msdn或者google或者baidu上搜索一些文本文件的读取吧
不难的..............
实在是不想写代码了...........
不难的..............
实在是不想写代码了...........
#2
dim i as integer, tmp as string
open "c:\test\a.txt" for input as #1
open "c:\test\b.txt" for output as #2
do until eof(1)
line input #1, tmp
tmp = mid(tmp, 9, 20)
for i = 1 to 20 step 4
print #2, "0X";
print #2, mid(tmp, i, 4);
print #2, ",";
next i
print #2, ""
loop
close #2
close #1
kill "c:\test\a.txt"
name "c:\test\b.txt" as "c:\test\a.txt"
open "c:\test\a.txt" for input as #1
open "c:\test\b.txt" for output as #2
do until eof(1)
line input #1, tmp
tmp = mid(tmp, 9, 20)
for i = 1 to 20 step 4
print #2, "0X";
print #2, mid(tmp, i, 4);
print #2, ",";
next i
print #2, ""
loop
close #2
close #1
kill "c:\test\a.txt"
name "c:\test\b.txt" as "c:\test\a.txt"
#3
rivate Sub Command1_Click()
Dim i As Integer, tmp As String
Dim y As Integer
Dim a() As String
Open "c:\test\old.txt" For Input As #1
Do Until EOF(1)
y = y + 1
Line Input #1, tmp
tmp = Mid(tmp, 9, 20)
ReDim Preserve a(y * 5 - 1) As String
a(y * 5 - 5) = "0x" & Mid(tim, 1, 4) & ","
a(y * 5 - 4) = "0x" & Mid(tim, 5, 4) & ","
a(y * 5 - 3) = "0x" & Mid(tim, 9, 4) & ","
a(y * 5 - 2) = "0x" & Mid(tim, 13, 4) & ","
a(y * 5 - 1) = "0x" & Mid(tim, 17, 4) & ","
Next i
Close #1
End Sub
Dim i As Integer, tmp As String
Dim y As Integer
Dim a() As String
Open "c:\test\old.txt" For Input As #1
Do Until EOF(1)
y = y + 1
Line Input #1, tmp
tmp = Mid(tmp, 9, 20)
ReDim Preserve a(y * 5 - 1) As String
a(y * 5 - 5) = "0x" & Mid(tim, 1, 4) & ","
a(y * 5 - 4) = "0x" & Mid(tim, 5, 4) & ","
a(y * 5 - 3) = "0x" & Mid(tim, 9, 4) & ","
a(y * 5 - 2) = "0x" & Mid(tim, 13, 4) & ","
a(y * 5 - 1) = "0x" & Mid(tim, 17, 4) & ","
Next i
Close #1
End Sub
#4
Private Sub Command1_Click()
Dim i As Long, j As Long
Dim strLine As String
Dim strNewline As String
Open 源文件名 For Input As #1
Open 修改后的文件名 For Output As #2
While Not EOF(1)
Line Input #1, strLine
For j = 9 To 24 Step 4
strNewline = strNewline & "0x" & Mid$(strLine, j, 4) & ","
Next
strNewline = strNewline & "0x" & Mid$(strLine, j, 4)
Print #2, strNewline
strNewline = ""
Wend
Close
End Sub
Dim i As Long, j As Long
Dim strLine As String
Dim strNewline As String
Open 源文件名 For Input As #1
Open 修改后的文件名 For Output As #2
While Not EOF(1)
Line Input #1, strLine
For j = 9 To 24 Step 4
strNewline = strNewline & "0x" & Mid$(strLine, j, 4) & ","
Next
strNewline = strNewline & "0x" & Mid$(strLine, j, 4)
Print #2, strNewline
strNewline = ""
Wend
Close
End Sub
#5
都写了,偶就不贴了!
楼主记得结贴哦!
楼主记得结贴哦!
#6
路过,哈哈!!
#7
我试了 可以实现了 不过我数据个数说错了应该是76个 我想应该把20改成64就可以了吧
可调试发现要把 OF123说的方法中的tmp = mid(tmp, 9, 64) 9改成10 才能完全正确 不然就向右错了一位
Songyaowu的方法也是要把9改成10 数据才对 我不太明白 应该是从9位开始读没错阿
可调试发现要把 OF123说的方法中的tmp = mid(tmp, 9, 64) 9改成10 才能完全正确 不然就向右错了一位
Songyaowu的方法也是要把9改成10 数据才对 我不太明白 应该是从9位开始读没错阿
#8
20FF4000004010601860327E3FAF30BB657A7E52DAB2FF7E18C619E21FF51DD53AC710FC4Cf:
20FF6000000010801C41397F3FE1319123B93FB95BF57FFF59FD19BD1F991D81398F11837Af;
20FF80000000003002307F781868386C3CC63F8737FE3630763036303E30363037FF220049f:
20FFA000000002420D7F19E625E446EC0F681BEC31E63FE65B7E1B7C1B681F601B60186018f:
20FFC000010007C0079007F80D8009881FFC29B839B03FFE69504951FFFF081008100810EAf:
20FFE0000008000C108C1C4C183C182C7F8C584C186C182E187F1FCC3C0C700C400C000C3Af:
这是部分数据
20FF6000000010801C41397F3FE1319123B93FB95BF57FFF59FD19BD1F991D81398F11837Af;
20FF80000000003002307F781868386C3CC63F8737FE3630763036303E30363037FF220049f:
20FFA000000002420D7F19E625E446EC0F681BEC31E63FE65B7E1B7C1B681F601B60186018f:
20FFC000010007C0079007F80D8009881FFC29B839B03FFE69504951FFFF081008100810EAf:
20FFE0000008000C108C1C4C183C182C7F8C584C186C182E187F1FCC3C0C700C400C000C3Af:
这是部分数据
#9
阿因为粘贴出错有些数量不兑 反正都是76个字符了
#10
解决了吗, 那就jf
#11
大哥 我想不通为啥改成10阿 我很菜 可也想学习一下阿 别那么急好不 我肯定结的
#1
在csdn或者msdn或者google或者baidu上搜索一些文本文件的读取吧
不难的..............
实在是不想写代码了...........
不难的..............
实在是不想写代码了...........
#2
dim i as integer, tmp as string
open "c:\test\a.txt" for input as #1
open "c:\test\b.txt" for output as #2
do until eof(1)
line input #1, tmp
tmp = mid(tmp, 9, 20)
for i = 1 to 20 step 4
print #2, "0X";
print #2, mid(tmp, i, 4);
print #2, ",";
next i
print #2, ""
loop
close #2
close #1
kill "c:\test\a.txt"
name "c:\test\b.txt" as "c:\test\a.txt"
open "c:\test\a.txt" for input as #1
open "c:\test\b.txt" for output as #2
do until eof(1)
line input #1, tmp
tmp = mid(tmp, 9, 20)
for i = 1 to 20 step 4
print #2, "0X";
print #2, mid(tmp, i, 4);
print #2, ",";
next i
print #2, ""
loop
close #2
close #1
kill "c:\test\a.txt"
name "c:\test\b.txt" as "c:\test\a.txt"
#3
rivate Sub Command1_Click()
Dim i As Integer, tmp As String
Dim y As Integer
Dim a() As String
Open "c:\test\old.txt" For Input As #1
Do Until EOF(1)
y = y + 1
Line Input #1, tmp
tmp = Mid(tmp, 9, 20)
ReDim Preserve a(y * 5 - 1) As String
a(y * 5 - 5) = "0x" & Mid(tim, 1, 4) & ","
a(y * 5 - 4) = "0x" & Mid(tim, 5, 4) & ","
a(y * 5 - 3) = "0x" & Mid(tim, 9, 4) & ","
a(y * 5 - 2) = "0x" & Mid(tim, 13, 4) & ","
a(y * 5 - 1) = "0x" & Mid(tim, 17, 4) & ","
Next i
Close #1
End Sub
Dim i As Integer, tmp As String
Dim y As Integer
Dim a() As String
Open "c:\test\old.txt" For Input As #1
Do Until EOF(1)
y = y + 1
Line Input #1, tmp
tmp = Mid(tmp, 9, 20)
ReDim Preserve a(y * 5 - 1) As String
a(y * 5 - 5) = "0x" & Mid(tim, 1, 4) & ","
a(y * 5 - 4) = "0x" & Mid(tim, 5, 4) & ","
a(y * 5 - 3) = "0x" & Mid(tim, 9, 4) & ","
a(y * 5 - 2) = "0x" & Mid(tim, 13, 4) & ","
a(y * 5 - 1) = "0x" & Mid(tim, 17, 4) & ","
Next i
Close #1
End Sub
#4
Private Sub Command1_Click()
Dim i As Long, j As Long
Dim strLine As String
Dim strNewline As String
Open 源文件名 For Input As #1
Open 修改后的文件名 For Output As #2
While Not EOF(1)
Line Input #1, strLine
For j = 9 To 24 Step 4
strNewline = strNewline & "0x" & Mid$(strLine, j, 4) & ","
Next
strNewline = strNewline & "0x" & Mid$(strLine, j, 4)
Print #2, strNewline
strNewline = ""
Wend
Close
End Sub
Dim i As Long, j As Long
Dim strLine As String
Dim strNewline As String
Open 源文件名 For Input As #1
Open 修改后的文件名 For Output As #2
While Not EOF(1)
Line Input #1, strLine
For j = 9 To 24 Step 4
strNewline = strNewline & "0x" & Mid$(strLine, j, 4) & ","
Next
strNewline = strNewline & "0x" & Mid$(strLine, j, 4)
Print #2, strNewline
strNewline = ""
Wend
Close
End Sub
#5
都写了,偶就不贴了!
楼主记得结贴哦!
楼主记得结贴哦!
#6
路过,哈哈!!
#7
我试了 可以实现了 不过我数据个数说错了应该是76个 我想应该把20改成64就可以了吧
可调试发现要把 OF123说的方法中的tmp = mid(tmp, 9, 64) 9改成10 才能完全正确 不然就向右错了一位
Songyaowu的方法也是要把9改成10 数据才对 我不太明白 应该是从9位开始读没错阿
可调试发现要把 OF123说的方法中的tmp = mid(tmp, 9, 64) 9改成10 才能完全正确 不然就向右错了一位
Songyaowu的方法也是要把9改成10 数据才对 我不太明白 应该是从9位开始读没错阿
#8
20FF4000004010601860327E3FAF30BB657A7E52DAB2FF7E18C619E21FF51DD53AC710FC4Cf:
20FF6000000010801C41397F3FE1319123B93FB95BF57FFF59FD19BD1F991D81398F11837Af;
20FF80000000003002307F781868386C3CC63F8737FE3630763036303E30363037FF220049f:
20FFA000000002420D7F19E625E446EC0F681BEC31E63FE65B7E1B7C1B681F601B60186018f:
20FFC000010007C0079007F80D8009881FFC29B839B03FFE69504951FFFF081008100810EAf:
20FFE0000008000C108C1C4C183C182C7F8C584C186C182E187F1FCC3C0C700C400C000C3Af:
这是部分数据
20FF6000000010801C41397F3FE1319123B93FB95BF57FFF59FD19BD1F991D81398F11837Af;
20FF80000000003002307F781868386C3CC63F8737FE3630763036303E30363037FF220049f:
20FFA000000002420D7F19E625E446EC0F681BEC31E63FE65B7E1B7C1B681F601B60186018f:
20FFC000010007C0079007F80D8009881FFC29B839B03FFE69504951FFFF081008100810EAf:
20FFE0000008000C108C1C4C183C182C7F8C584C186C182E187F1FCC3C0C700C400C000C3Af:
这是部分数据
#9
阿因为粘贴出错有些数量不兑 反正都是76个字符了
#10
解决了吗, 那就jf
#11
大哥 我想不通为啥改成10阿 我很菜 可也想学习一下阿 别那么急好不 我肯定结的