This forum uses cookies. Click X button to hide this message. What is stored? / Privacy
Total Commander Forum Index Total Commander
Forum - Public Discussion and Support
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Compare by content: Possible to ignore first n lines?

 
Post new topic   Reply to topic    Total Commander Forum Index -> Total Commander (English) Printable version
View previous topic :: View next topic  
Author Message
Asperamanca
Junior Member
Junior Member


Joined: 28 Mar 2005
Posts: 22

PostPosted: Fri Oct 13, 2017 4:18 am    Post subject: Compare by content: Possible to ignore first n lines? Reply with quote

I have a case where I need to compare two deep folder trees. Problem is that all files include a header, where a date and version number of the files is updated via script. If I compare by content, all files are marked as different, because this date and version number has been changed.
However, I'd like to know which files actually have different content apart from that header.

Is there any way, e.g. telling the sync tool to ignore the first n lines in each file?
Back to top
View user's profile Send private message
MVV
Power Member
Power Member


Joined: 03 Aug 2008
Posts: 8063
Location: Russian Federation

PostPosted: Fri Oct 13, 2017 4:47 am    Post subject: Reply with quote

You can't tell TC to do that, you only can use custom comparer plugin that will ignore first lines...
_________________
TCFS2 + TCFS2Tools: Full-screen mode for TC etc (forum)
TOTALCMD.NET: AskParam, CopyTree, NTLinks, Sudo, VirtualPanel…
Back to top
View user's profile Send private message Send e-mail
ghisler(Author)
Site Admin
Site Admin


Joined: 04 Feb 2003
Posts: 35974
Location: Switzerland

PostPosted: Sun Oct 15, 2017 1:04 am    Post subject: Reply with quote

You can use file "filesys" content plugin as a starting point, it has a text compare function "ContentCompareFiles". All you need to do is skip the first X lines per file.
_________________
Author of Total Commander
http://www.ghisler.com
Back to top
View user's profile Send private message Send e-mail Visit poster's website
JacobK
Junior Member
Junior Member


Joined: 20 Apr 2018
Posts: 3

PostPosted: Fri Apr 20, 2018 6:17 pm    Post subject: result "less" and "greater"? Reply with quote

Is it possible, in content plugin from ContentCompareFiles, to return result "less" and "greater"?
Back to top
View user's profile Send private message
ghisler(Author)
Site Admin
Site Admin


Joined: 04 Feb 2003
Posts: 35974
Location: Switzerland

PostPosted: Mon Apr 23, 2018 7:17 am    Post subject: Reply with quote

No, because the sync tool does not distinguish between larger/smaller files when selecting them. It only sets options equal, not equal, equal if text, left newer, right newer.
_________________
Author of Total Commander
http://www.ghisler.com
Back to top
View user's profile Send private message Send e-mail Visit poster's website
JacobK
Junior Member
Junior Member


Joined: 20 Apr 2018
Posts: 3

PostPosted: Mon Apr 23, 2018 6:54 pm    Post subject: Reply with quote

Thank you, Christian.

OK, how can I return "left newer", "right newer"?
In contentpluginhelp2.10se.zip/contentplugin.HLP it lists:

Quote:
1 The two files are equal, show equal sign in list
2 The two files are equal, show equal sign with 'TXT' below it in lists:
0 The two files are different
-1 Could not open at least one of the files
-2 Compare aborted
-3 The file cannot be compared with this function, please continue with the next plugin...
100 or higher The two files are equal. The plugin file contains a 16x16 icon resource with this numeric ID...


No option for "left newer", "right newer" is mentioned...
Back to top
View user's profile Send private message
Dalai
Power Member
Power Member


Joined: 28 Jan 2005
Posts: 6086
Location: Meiningen (Südthüringen)

PostPosted: Mon Apr 23, 2018 7:43 pm    Post subject: Reply with quote

2JacobK
What do you want to achieve? TC's sync tool already compares file dates without comparison by contents (let alone by contents via content plugins).

Regards
Dalai
_________________
#101164 Personal licence
Athlon X4 880K, 16 GiB RAM, Gigabyte F2A88X-D3HP, Win7 x64

Plugins: Services2, Startups
Back to top
View user's profile Send private message Send e-mail
JacobK
Junior Member
Junior Member


Joined: 20 Apr 2018
Posts: 3

PostPosted: Mon Apr 23, 2018 7:54 pm    Post subject: Reply with quote

I want to create compare plugin which may include custom criteria, not limited to last modification date-time, or even any date-time, and return not only '==' and '!=' results, but also '>' and '<'.
Thank you,
Jacob
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Total Commander Forum Index -> Total Commander (English) All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Imprint/Impressum: This site is maintained by Ghisler Software GmbH
Privacy Policy | Datenschutzerklärung | Politique de Confidentialité

Using phpBB © phpBB Group