导出文本格式,如何操作,急!

pp_key 2003-10-21 11:03:12
现急需导出文本形式的格式,格式大致如下:
9610001~~3~~远方公司~~321000~~湖北~~共行~~

如何写成这样,急,分不够再加~
...全文
48 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
incats 2003-10-24
  • 打赏
  • 举报
回复
写4个"~"

是金穗接口吧? "~"偏巧是PB的重定义符, 只能"~~"表示一个"~"了.
liliang800207 2003-10-22
  • 打赏
  • 举报
回复
dw_1.SaveAsAscii ("file1.txt","~~")

还可以用循环读取数据窗口中的内容
再以行模式写道固定的文件中
当然效率不如前者高
但可以保证正确率
fanhuihh 2003-10-22
  • 打赏
  • 举报
回复
你是数据窗口存文件吗
如果是的话:dw_1.saveas()
佣工7001 2003-10-21
  • 打赏
  • 举报
回复
dw_1.SaveAsAscii ("file1.txt","~~")

~~不知道是写4个还是2个,你试试
jdsnhan 2003-10-21
  • 打赏
  • 举报
回复
用SaveAsAscii("*.txt","~~","")可以吗?
killerdanny 2003-10-21
  • 打赏
  • 举报
回复
这个很简单哦!

global type f_writefile from function_object
end type

forward prototypes
global function integer f_writefile (string filename, ref blob fb, boolean bappend)
end prototypes

global function integer f_writefile (string filename, ref blob fb, boolean bappend);int result,fnum,loops,i;
long flen, bytes_read, new_pos
Blob b;
/////////////////////////////
IF ISNULL(b) THEN
MessageBox("错误","no Data need To write to file(blob is null)!",INFORMATION!);
GOTO ERROR;
END IF
// Get the file length, and open the file
flen = len(fb);
// Determine how many times to call FileRead
IF (flen <=0) THEN
// MessageBox("Error","no Data need To write to file(blob=0)!",INFORMATION!);
GOTO ERROR;
END IF
if bAppend then
fnum = FileOpen(filename,StreamMode!, Write!, LockWrite!,Append!);
else
fnum = FileOpen(fileName,StreamMode!,write!,LockWrite!,Replace!);
end if
IF (fnum <1) THEN
MessageBox("打开文件错误","不能打开目标文件~r~n"+fileName);
GOTO ERROR;
END IF
IF flen > 32765 THEN
IF Mod(flen, 32765) = 0 THEN
loops = flen/32765
ELSE
loops = (flen/32765) + 1
END IF
ELSE
loops = 1
END IF
////****** Read the file ******//
new_pos = 1
FOR i = 1 to loops
b = Blobmid(fb,new_pos,32765);
bytes_read = FileWrite(fnum, b)
new_pos +=bytes_read;
NEXT
FileClose(fnum);
////////////////////////////
RETURN 1; //***** Return 1 As Successful;
ERROR:
Return -1; //***** Return -1 As Failure



end function

//上面函数声明!
klbt 2003-10-21
  • 打赏
  • 举报
回复
用dw_Quarter.SaveAsAscii("A.TXT","~~","")函数

1,079

社区成员

发帖
与我相关
我的任务
社区描述
PowerBuilder 相关问题讨论
社区管理员
  • 基础类社区
  • WorldMobile
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧