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