Home > database >  The practice of pb literacy TXT file
The practice of pb literacy TXT file

Time:09-16

There is c: \ HotelBill. TXT content is as follows (to START the starting to the END and a newline (1310) at the END)
START 20 00000003 6401 6401 0.00 0.00 inside END
START 0.00 4 April 20, 00000004 shows the END
START 20 00000005 6401 6401 0.07 0.28 Beijing END

How to write to each line, line read a variable, delete the corresponding line after read at the same time, also is to read a line, delete a line?

Thank you

CodePudding user response:

Importfile can be used to import the database, and then use sp for processing, processing is completed the coma to archive folder

CodePudding user response:

refer to the original poster ghost_old response:
is c: \ HotelBill TXT content is as follows (to START the starting to the END and a newline (1310) at the END)
START 20 00000003 6401 6401 0.00 0.00 inside END
START 0.00 4 April 20, 00000004 shows the END
START 20 00000005 6401 6401 0.07 0.28 Beijing END

How to write to each line, line read a variable, delete the corresponding line after read at the same time, also is to read a line, delete a line?

Thank you


Suggest you use to implement the data window, a new External data sources data window (for External data source, type in the Grid), then put 15 fields, type string (50), and then use dw_1, importfile (' c: \ HotelBill. TXT), the data import data directly to the window, and then from the data window handle are better dealt with

CodePudding user response:

Pb doesn't support single file delete character, read a line if you want to achieve, delete a line, can only use IMPORTFILE first imported into the external data window, external data window to read a line again, delete a line, you feel the HotelBill TXT like a log file, if it is to log after read out, avoid the log is too large, can produce a log every day, the file name with the date, after receiving to move to a backup folder using MoveFileA, if the file HotelBill. TXT is not generated, your software can be read in after, fileclose this file, fileopen again this file, but writemode use the Replace! All content, replace the file,

CodePudding user response:

The data window

CodePudding user response:

It is better to import into the data window, modify or query is very direct, dw_1, importfile (' c: \ HotelBill. TXT)

CodePudding user response:

The data window is the best way
  • Related