Import csv works but same with xls/xlsx gives parser error

If you have questions or if you want to share your opinion about Aware IM post your message on this forum
Post Reply
swiftinitpvtltd
Posts: 370
Joined: Sat Apr 28, 2018 3:33 am
Location: India
Contact:

Import csv works but same with xls/xlsx gives parser error

Post by swiftinitpvtltd »

Standard Import CSV aware process done via admin works but same xls/xlsx gives parser error. Is there any install I have to do to make xls or xlsx import work? CSV with same data works. I tried installing office 365 excel on server but it gave same error. In one of the imports I need to use xls/xlsx as excel has locked columns and dropdowns which CSV format can never have(but even xls without dropdowns and locked columns give me same error-Connection failure status:parsererror so there is a basic issue of not able to import xls or xlsx)
lueu
Posts: 89
Joined: Tue Mar 07, 2023 11:49 pm

Re: Import csv works but same with xls/xlsx gives parser error

Post by lueu »

I have the same problem! Anyone have an answer to this?
joben
Posts: 221
Joined: Wed Nov 06, 2019 9:49 pm
Location: Sweden
Contact:

Re: Import csv works but same with xls/xlsx gives parser error

Post by joben »

Importing xlsx is not supported.

I am currently trying to make a workaround for Windows Server.

What I am doing so far is using a process like:
1. New form where I upload the xlsx file.
2. Export the file to the server.
3. run a powershell script with EXECUTE PROGRAM that converts it to csv (sorry about the somewhat illogical variable names, this is not finished):

Code: Select all

#Install-module PSExcel
Import-module PSExcel
$xlsxFile="HardwareImport.xlsx"
$csvname='C:\acme\'+$xlsxFile.replace('xlsx','csv')
$xlsFilePath='C:\acme\'+$xlsxFile
$rawFile = Import-XLSX -Path $xlsFilePath
$rawFile | Export-Csv $csvname -Encoding UTF8 -NoTypeInformation
4. import the csv file from the server using a predefined template.
5. profit, hopefully

My progress so far? All of the above steps are actually working for me, as long as the file doesn't have too many rows.
I can give more concrete information with proper AwareIM rules later if you want, but I can't access the BSV right now.

I also recommend having a look inside the database table, because chances are your failed xlsx import messed up the BO, making it impossible to display. Delete the row with messed up data if it exists.
Regards, Joakim

Image
ACDC
Posts: 1138
Joined: Sat Jun 30, 2007 5:03 pm
Location: California, USA

Re: Import csv works but same with xls/xlsx gives parser error

Post by ACDC »

An alternative approach to address this issue involves converting the file into a MySql table and utilizing the external database table. This approach enables the importation of intricate Excel files, including multiple sheets. I personally rely on this method for all my data import tasks. Additionally, there is a Command Line Interface (CLI) version available, allowing seamless automation of the process directly within AwareIM. It functions flawlessly.

https://www.excel2mysql.com/index.html
Post Reply