现在我给数据加了后缀了,请问如何把加完之后执行后再给后缀去掉呢。 For Each f As String In System.IO.Directory.GetFiles(_dataFileDir, CStr(dtHashTableConstIfId.Item(_pgm_id)) & "*") If Not IO.Path.GetExtension(f).ToLower = ".dat" Then IO.File.Move(f, IO.Path.ChangeExtension(f, ".dat")) End If Next 如何给去掉后缀呢 IO.File.Move(f, IO.Path.ChangeExtension(f, "")) 这样可以吗
'バックアップファイルの名前を定義するために、拡張子を削除する、 For Each f As String In System.IO.Directory.GetFiles(strBackUpFileAll, CStr(dtHashTableConstIfId.Item(_pgm_id)) & "*") If IO.Path.GetExtension(f).ToLower = ".dat" Then If File.Exists(strBackUpFileAll & "\" & IO.Path.GetFileNameWithoutExtension(f)) Then File.Delete(strBackUpFileAll & "\" & IO.Path.GetFileNameWithoutExtension(f)) End If IO.File.Move(f, IO.Path.ChangeExtension(f, "")) End If Next 已解决,估计上面的只能加后缀然后再删除后缀的形势来实现了
load data infile * into table tablename replace fields terminater by ',' optionally enclose by '"' ( 字段1, 字段2,
For Each f As String In System.IO.Directory.GetFiles(_dataFileDir, CStr(dtHashTableConstIfId.Item(_pgm_id)) & "*")
If Not IO.Path.GetExtension(f).ToLower = ".dat" Then
IO.File.Move(f, IO.Path.ChangeExtension(f, ".dat"))
End If
Next
如何给去掉后缀呢
IO.File.Move(f, IO.Path.ChangeExtension(f, "")) 这样可以吗
'バックアップファイルの名前を定義するために、拡張子を削除する、
For Each f As String In System.IO.Directory.GetFiles(strBackUpFileAll, CStr(dtHashTableConstIfId.Item(_pgm_id)) & "*") If IO.Path.GetExtension(f).ToLower = ".dat" Then
If File.Exists(strBackUpFileAll & "\" & IO.Path.GetFileNameWithoutExtension(f)) Then
File.Delete(strBackUpFileAll & "\" & IO.Path.GetFileNameWithoutExtension(f))
End If
IO.File.Move(f, IO.Path.ChangeExtension(f, "")) End If
Next
已解决,估计上面的只能加后缀然后再删除后缀的形势来实现了
load data
infile *
into table tablename
replace
fields terminater by ',' optionally enclose by '"'
(
字段1,
字段2,
字段n
) 后缀名为.csv
或者写成*也行!