여러 PDF 파일을 데이터 테이블로 가져 오는 방법경고 : 스크립팅이 처음입니다.
도전 :
- 약 500 개의 pdf 파일이 있는데, 각 파일에는 JMP로 가져오고 단일 jmp 데이터 테이블로 조합하려는 데이터 테이블이 포함되어 있습니다.
작업 흐름 및 문제 :
- 하나의 pdf에서 표로 작성된 데이터를 가져와 내가 호출 한 테이블에 추가 할 수있는 스크립트 (아래 참조)를 만들었습니다. Final.jmp . 스크립트를 별도의 파일로 보관했습니다. 즉, 데이터 테이블 안에 보관하지 않았습니다. 각 PDF는 다음에 추가됩니다. Final.jmp 단일 행으로.
- 가져올 때마다 닫아야합니다. Final.jmp 테이블을 열고 새로 가져온 pdf의 추가 행을 포함하는 업데이트 된 새 "최종"테이블로 덮어 씁니다.
- 각 가져 오기 후에는 프로세스에서 생성되는 모든 중간 테이블을 수동으로 닫아야합니다. (지루한)
- 그런 다음 스크립트에서 pdf 파일 이름을 변경하고 저장을 누른 다음 다시 실행하여 다른 pdf를 가져옵니다. 그래서 순환이 계속됩니다.
- 이 프로세스는 수동 복사 붙여 넣기보다 빠르지 만 여전히 힘들고 컴퓨터 과학에 일반적으로 자동화되지 않은 거의 확실합니다.
질문 :
- 가져올 새 pdf를 선택할 때마다 한 폴더의 모든 pdf를 가져올 때까지 동일한 테이블에 추가 할 때마다 스크립트를 반복적으로 실행할 수 있습니까?
Open(
"C:\example folder\example.pdf",
PDF Tables(
Table(
table name( "1" ),
add rows( page( 1 ), Rect( 2.0419, 0.9776, 3.1993, 1.1726 ) ),
add rows( page( 1 ), Rect( 1.2137, 3.7819, 6.3603, 3.9069 ) ),
add rows( page( 1 ), Rect( 0.8717, 3.9636, 3.0796, 4.0886 ) ),
add rows(
page( 1 ),
Rect( 0.9853, 4.1436, 3.0029, 4.2686 ),
column borders( 0.9853, 2.5416, 3.0029 )
),
add rows( page( 1 ), Rect( 4.581, 4.1436, 7.297, 4.2686 ) ),
add rows(
page( 1 ),
Rect( 0.8883, 4.4136, 4.6374, 4.5386 ),
column borders( 0.8883, 1.9603, 4.6374 )
),
add rows(
page( 1 ),
Rect( 6.0143, 4.6569, 7.2498, 4.7819 ),
column borders( 6.0143, 6.5817, 7.2498 )
),
add rows( page( 1 ), Rect( 0.7556, 4.7979, 7.5908, 8.2654 ) )
)
)
);
Data Table( "1" ) << Stack(
columns( :Column 3, :Column 4, :Column 5, :Column 6 ),
Source Label Column( "Label" ),
Stacked Data Column( "Data" ),
Output table("2")
);
Data Table( "2" ) << Transpose(
columns( :Data ),
Output Table( "3" )
);
Data Table( "Final" ) << Concatenate( Data Table( "3" ) )
데이터 테이블스크립팅Re : 여러 PDF 파일을 데이터 테이블로 가져 오는 방법해야 할 일은 코드를 반복하면서 파일을 하나씩 읽어 최종 데이터 테이블에 추가하는 것입니다.아래의 JSL은이를 수행하는 방법에 대한 좋은 시작을 제공합니다.
Names default to here(1);
// Here is an example where the first thing that is done, is to create
// the list of the files to be processed
// Many different methods can be used to do this, but for this example
// the file names are read in from a directory
theFilesList = Files in directory( <PATH to="" your="" folder="" that="" has="" the="" .pdf="" files=""> );
// Create the Final data table that will have all of the processed files
// concatenated to it
Data Table( "Final" );
// Loop across all of the files and read them in one at a time and add them
// to the Final data table
For( i = 1, i <= N Items( theFilesList ), i++,
Open(
theFilesList[i],
PDF Tables(
Table(
table name( "1" ),
add rows( page( 1 ), Rect( 2.0419, 0.9776, 3.1993, 1.1726 ) ),
add rows( page( 1 ), Rect( 1.2137, 3.7819, 6.3603, 3.9069 ) ),
add rows( page( 1 ), Rect( 0.8717, 3.9636, 3.0796, 4.0886 ) ),
add rows( page( 1 ), Rect( 0.9853, 4.1436, 3.0029, 4.2686 ), column borders( 0.9853, 2.5416, 3.0029 ) ),
add rows( page( 1 ), Rect( 4.581, 4.1436, 7.297, 4.2686 ) ),
add rows( page( 1 ), Rect( 0.8883, 4.4136, 4.6374, 4.5386 ), column borders( 0.8883, 1.9603, 4.6374 ) ),
add rows( page( 1 ), Rect( 6.0143, 4.6569, 7.2498, 4.7819 ), column borders( 6.0143, 6.5817, 7.2498 ) ),
add rows( page( 1 ), Rect( 0.7556, 4.7979, 7.5908, 8.2654 ) )
)
)
);
Data Table( "1" ) << Stack(
columns( :Column 3, :Column 4, :Column 5, :Column 6 ),
Source Label Column( "Label" ),
Stacked Data Column( "Data" ),
Output table( "2" )
);
Data Table( "2" ) << Transpose( columns( :Data ), Output Table( "3" ) );
// Concatenate the processed data to the Final data table
Data Table( "Final" ) << Concatenate( Data Table( "3" ), Append to first table( 1 ) );
// Cleanup the environment
Close( Data Table( "1" ), nosave );
Close( Data Table( "2" ), nosave );
Close( Data Table( "3" ), nosave );
);</PATH>Re : 여러 PDF 파일을 데이터 테이블로 가져 오는 방법헉헉 , 고마움을 제대로 표현하는 방법을 모르겠습니다. 당신은 매우 친절합니다. 다시 한 번 도와 주셔서 감사합니다!
Re : 여러 PDF 파일을 데이터 테이블로 가져 오는 방법죄송합니다. 수년간의 학술 교육에도 불구하고이 루프를 작동시킬 수 없기 때문에 더 많은 질문을 가지고 돌아와야합니다. 이 작업을 수행하기 위해 시도한 내용은 다음과 같습니다. 먼저 모든 파일을 로컬 하드 디스크로 옮겼습니다. 어떤 이유로 서버의 일부 폴더 이름에 "()"를 사용하고 있는데 이것이 문제를 일으키는 것 같은 인상을 받았기 때문입니다. . 결국 나는 따옴표를 사용하여 스크립트의 전체 디렉토리를 "인용"했습니다. 이것은 스크립트가 다음 오류 메시지까지 실행되도록하는 것처럼 보였습니다. 그런 다음 "Path is invalid ... 'Glue'..."에 대해 알려주었습니다. 나는 그것을 봤지만 그 문제를 해결하는 방법을 모른다. 오류 메시지의 파일 이름이 작업하려는 디렉토리에있는 파일 중 하나의 이름임을 알 수 있습니다. 처음에는 파일 이름의 하이픈이 문제를 일으키고 있다고 생각했지만 변경하더라도 오류가 발생합니다.
아래에 붙여 넣었습니다.
- 가짜 디렉토리 이름이있는 스크립트 사본. 폴더 수와 괄호가 포함 된 폴더 이름을 유지했습니다.
- 스크립트 창의 오류 메시지
- 디버깅의 오류 메시지
또한 최종 데이터 테이블에 디렉토리와 파일 이름을 어떻게 포함합니까?
미리 감사드립니다! (이것이 대답하기에 너무 사소하다고 생각되면 이해하겠습니다.)


Names default to here(1);
// Here is an example where the first thing that is done, is to create
// the list of the files to be processed
// Many different methods can be used to do this, but for this example
// the file names are read in from a directory
theFilesList = Files in directory( "C:\directory1\subdirectory1\subdirectory2\subdirectory3 (nameof aperson)\subdirectory4\subdirectory5\subdirectory6\subdirectory7\subdirectory8\subdirectory9\subdirectory10" );
// Create the Final data table that will have all of the processed files
// concatenated to it
Data Table( "Final" );
// Loop across all of the files and read them in one at a time and add them
// to the Final data table
For( i = 1, i <= N Items( theFilesList ), i++,
Open(
theFilesList[i],
PDF Tables(
Table(
table name( "1" ),
add rows( page( 1 ), Rect( 2.0419, 0.9776, 3.1993, 1.1726 ) ),
add rows( page( 1 ), Rect( 1.2137, 3.7819, 6.3603, 3.9069 ) ),
add rows( page( 1 ), Rect( 0.8717, 3.9636, 3.0796, 4.0886 ) ),
add rows( page( 1 ), Rect( 0.9853, 4.1436, 3.0029, 4.2686 ), column borders( 0.9853, 2.5416, 3.0029 ) ),
add rows( page( 1 ), Rect( 4.581, 4.1436, 7.297, 4.2686 ) ),
add rows( page( 1 ), Rect( 0.8883, 4.4136, 4.6374, 4.5386 ), column borders( 0.8883, 1.9603, 4.6374 ) ),
add rows( page( 1 ), Rect( 6.0143, 4.6569, 7.2498, 4.7819 ), column borders( 6.0143, 6.5817, 7.2498 ) ),
add rows( page( 1 ), Rect( 0.7556, 4.7979, 7.5908, 8.2654 ) )
)
)
);
Data Table( "1" ) << Stack(
columns( :Column 3, :Column 4, :Column 5, :Column 6 ),
Source Label Column( "Label" ),
Stacked Data Column( "Data" ),
Output table( "2" )
);
Data Table( "2" ) << Transpose( columns( :Data ), Output Table( "3" ) );
// Concatenate the processed data to the Final data table
Data Table( "Final" ) << Concatenate( Data Table( "3" ), Append to first table( 1 ) );
// Cleanup the environment
Close( Data Table( "1" ), nosave );
Close( Data Table( "2" ), nosave );
Close( Data Table( "3" ), nosave );
);
Re : 여러 PDF 파일을 데이터 테이블로 가져 오는 방법내 오류 ........
Data table( "Final" );
지정되어야 함
New Table( "Final" );