n********6 发帖数: 1511 | 1 Objective: To get the file size and put into col
Problem: file size increase to the left, the following script get the output
like '30 MITBBS_ID_...'
STEP 1:
shell, bcp, get dirlist.txt like below:
...
09/12/2011 02:50 PM 30 MITBBS_id_TEST001.TXT
...
STEP 2:
SELECT RTRIM(SUBSTRING(Directory_string, 40, 80)) AS FILE_NAME_IN,
RTRIM(SUBSTRING(Directory_string, 1, 20)) AS FILE_DATE,
LTRIM(SUBSTRING(Directory_string, 21, 40)) AS FILE_SIZE
FROM ##P_Import_ORR_ORIG_DOC_Directory | i****a 发帖数: 36252 | 2 use "space" as seperators. search for 1st non-space character after a space
for next field
output
【在 n********6 的大作中提到】 : Objective: To get the file size and put into col : Problem: file size increase to the left, the following script get the output : like '30 MITBBS_ID_...' : STEP 1: : shell, bcp, get dirlist.txt like below: : ... : 09/12/2011 02:50 PM 30 MITBBS_id_TEST001.TXT : ... : STEP 2: : SELECT RTRIM(SUBSTRING(Directory_string, 40, 80)) AS FILE_NAME_IN,
| n********6 发帖数: 1511 | 3 Thank you. Will try.
space
【在 i****a 的大作中提到】 : use "space" as seperators. search for 1st non-space character after a space : for next field : : output
|
|