Import ascii failing + cleaning "Files of type" ascii importer dropdown

Hello,

It's driving me crazy since it has worked for months...

Anyway hopefully someone will know what's wrong.

Importing the below file with the settings below does NOT work anymore on my windows 2016 server. It worked for months without a single issue.

File:
https://dropzone-ba.s3.eu-west-1.amazonaws.com/SampleSignalForeign.csv

Import settings:
https://dropzone-ba.s3.eu-west-1.amazonaws.com/2022-07-15_16-27-34.png

I suspect that I may have changed the file encoding when working remotely between windows/mac (but I couldn't find anything telling what file encoding should be used?).

I'm using sublimtext on my Mac to create the import signal CSV file.

Any idea of what the problem / solution might be?

Another question : Trying to solve that problem, I've created tons of ascii import settings that I need to delete since none of them solved anything... How do I clean up the "Files of type" ascii importer dropdown (which list saved imported definitions/settings).

Thanks a lot,

Hello BenA,

could it be possible your " import signal CSV file" has not correct end of line sequence 0d 0a ? Yours is only 0a ...

eol_0d_0a

Best regards,
Peter

The "input for the requested combobox" should be:

C:\Program Files\AmiBroker\Formats\import.types

  1. Close Amibroker Application
  2. Edit import.types
  3. Save import.types
  4. Start Amibroker Application

This could be helpful with your sublime text on mac:

https://developpaper.com/question/sublime-has-set-the-default-line-endings-as-unix-but-whether-to-open-a-file-with-the-right-click-menu-or-windows/

Thanks @Pietro for the C:\Program Files\AmiBroker\Formats\import.types it works fine!

Else I've changed my file and now obtain:

cat -e myfile.csv

giving back:

2022-07-06,0,0^M$
2022-07-07,1,0^M$
2022-07-08,0,0^M$
2022-07-11,0,0^M$
2022-07-12,1,0^M$
2022-07-13,1,0^M$

Which is apparently the DOS/Windows CRLF line breaks, but it still doesn't import properly.

I don't know which format Amibroker wants.

Humm, I've tried:
DOS/Windows CRLF
UTF8 + CRLF
Windows1250 + CRLF
UTF8 + LF
UTF8 BOM + LF

Absolutely none of them works.

I'm trying to wonder if it's really an encoding problem or something else.

Your original ASCII csv with UNIX eol (MAC AWS version) is working correct/well

  1. Create BenA.format file in C:\Program Files\AmiBroker\Formats
# Format definition file generated automatically
# by AmiBroker's ASCII Import Wizard
$FORMAT Date_YMD,Aux1,Aux2
$SKIPLINES 0
$SEPARATOR ,
$AUTOADD 1
$ALLOWNEG 1
$NOQUOTES 1
$BREAKONERR 1
  1. Use Amibroker File - Import ASCII ...
  2. Choose your csv from Apple MAC
  3. Choose BenA.format
  4. Run AB Import process

BenA_import_ascii

Your data file attempts to import 0 (zero) as close price. Price of zero is not allowed by default, so it will NOT work, unless you use "Allow negative prices" option (which allows negative AND ZERO prices) in the Import Wizard (or $ALLOWNEG 1 in format definition)

FWIW: Line endings don't matter. AmiBroker accepts both Unix-like and Windows-like.

In the future, just look inside "import.log" file - it will tell you precisely what is wrong (use $DEBUG 1 to have log generated for you).

More information: Import from ASCII file

1 Like

This topic was automatically closed 100 days after the last reply. New replies are no longer allowed.