1*2726a701SXin LI 2*2726a701SXin LI#------------------------------------------------------------------------------ 3*2726a701SXin LI# $File: dif,v 1.1 2020/04/09 19:14:01 christos Exp $ 4*2726a701SXin LI# dif: file(1) magic for DIF text files 5*2726a701SXin LI 6*2726a701SXin LI#------------------------------------------------------------------------------ 7*2726a701SXin LI# From: Joerg Jenderek 8*2726a701SXin LI# URL: http://en.wikipedia.org/wiki/Data_Interchange_Format 9*2726a701SXin LI# http://fileformats.archiveteam.org/wiki/Data_Interchange_Format 10*2726a701SXin LI# Note: called by TrID "Data Interchange Format", 11*2726a701SXin LI# by DROID x-fmt/368 "VisiCalc Database" 12*2726a701SXin LI0 string TABLE 13*2726a701SXin LI# skip text starting with TABLE by looking for numeric version on 2nd line 14*2726a701SXin LI>6 search/2 0, 15*2726a701SXin LI# skip DROID x-fmt-41-signature-id-380.dif by looking for key word TUPLES at the beginning 16*2726a701SXin LI>>27 search/128 TUPLES Data Interchange Format 17*2726a701SXin LI# https://www.pcmatic.com/company/libraries/fileextension/detail.asp?ext=dif.html 18*2726a701SXin LI#!:mime application/x-dif-spreadsheet Gnumeric 19*2726a701SXin LI# https://github.com/LibreOffice/online/blob/master/discovery.xml 20*2726a701SXin LI#!:mime application/x-dif-document LibreOffice 21*2726a701SXin LI# https://www.wikidata.org/wiki/Wikidata:WikiProject_Informatics/File_formats/Lists/File_formats 22*2726a701SXin LI!:mime application/x-dif 23*2726a701SXin LI# https://extension.nirsoft.net/dif 24*2726a701SXin LI#!:mime application/vnd.ms-excel 25*2726a701SXin LI#!:mime text/plain 26*2726a701SXin LI!:ext dif 27*2726a701SXin LI# look for double quote 0x22 on 3rd line 28*2726a701SXin LI>>>10 search/3 " 29*2726a701SXin LI# skip if next character also double quote 30*2726a701SXin LI>>>>&0 ubyte !0x22 \b, generator or table name 31*2726a701SXin LI# comment like EXCEL, pwm enclosed in double quotes 32*2726a701SXin LI>>>>>&-2 string x %s 33*2726a701SXin LI 34