안녕하세요 팀,
엑셀 스프레드시트에서 이미지를 가져온 적 있으신가요? 스프레드시트 데이터도 함께 가져오는 게 이상적일 것 같습니다.
불가능해 보이지만, 여기 누군가가 불가능한 일을 실현했을지도 모릅니다.;)
최상의
플로리안
안녕하세요 @플로리안_보그트 ,
Excel(.xlsx) 파일의 이미지 데이터는 내부적으로 ZIP 형식으로 저장되므로 다음 JSL 코드를 사용하여 이미지를 추출할 수 있습니다.
// Open the Excel file (.xlsx) as a ZIP archive
za = Open( "$desktop\Big Class Families.xlsx", zip );
// Get the list of files inside the ZIP archive
dirlist = za << dir;
// Create a new data table with one column to store images
dt = New Table( "Import image from Excel", New Column( "Image", Expression ) );
// Initialize row index
row_i = 0;
// Loop through all files in the ZIP archive
For( p_i = 1, p_i <= N Items( dirlist ), p_i++,
// Check if the file has a .png extension (i.e., it's an image)
If( Right( dirlist[p_i], 4 ) == ".png" /*png data*/,
// Read the PNG file as binary (blob) data
myImageBlob = za << read( dirlist[p_i], Format( blob ) );
// Convert the binary data into an image object
myImage = New Image( myImageBlob, "png" );
// Add a new row to the data table
dt << Add Rows( 1 );
row_i++;
// Insert the image into the first column of the new row
dt[row_i, 1] = myImage;
)
);
If you also need to retrieve associated data or the location of the images within the worksheet, I recommend using a Python library such as openpyxl.
도움이 되길 바랍니다!
Arrigato gozaimasu, Yuichi-san!