Sublime Forum

Fixed Width Custom Format

#1

I am looking to create a custom syntax for a fixed width file. The problem is the single file contains multiple, for lack of a better word schemas, within the file depending on what the first 4 characters are. So for example the first segment of the of the file begins with FEAT. If a line begins with FEAT, the characters 5-10 is a value, 11-13 is a value, and 14-22 is a values. But if the line begins with GROS, the 5-11 is a value, 12-13 is a value, 13-20 is a value, and 21-29 is a value.

Is there a way to build custom coloring syntax that allows me to determine the formating based on the first 4 characters of each line?

0 Likes

#2

Yes, there is.

0 Likes

#3

Could you give me a little more? Or would you be willing to email off the forum?

0 Likes

#4

Can you post a sample file to clarify?

0 Likes

#5

It doesn’t seem to hold the formatting very well here. But here is an example of the file format. So for the FEAT section the rules are:
image

While the PERF sections rules are: (image in the next reply)

VERS RSM7.5.1             
POST 001913 08132019 07012019 00
THTR 0906 ACME QA 906                    
COMM                                                                                 
FEAT 28298    Feature Number 1                    00000000 WB     Content Creator               
FEAT 38674    Feature Number 2                    00000000 WB     Content Creator               
FEAT 44455    Feature Number 3                    00000000 SON    New Release Company           
FEAT 56623    Feature Number 4                    00000000 BVD    Someone at Somewhere          
FEAT 60077    Feature Number 5                    00000000 FOX    ACME Company Number 1         
FEAT 61918    Feature Number 6                    00000000 OPE    ACME Company Number 2         
FEAT 62033    Feature Number 7                    00000000 WB     Content Creator               
FEAT 62049    Feature Number 8                    00000000 WB     Content Creator               
FEAT 62228    Feature Number 9                    00000000 SON    New Release Company           
FEAT 62229    Feature Number 10                   00000000 UI     ACME Company Number 3         
FEAT 62234    Feature Number 11                   00000000 UI     ACME Company Number 3         
FEAT 62235    Feature Number 12                   00000000 WB     Content Creator               
FEAT 62246    Feature Number 13                   00000000 PAR    ACME Company Number 4         
FEAT 63329    Feature Number 14                   00000000 SON    New Release Company           
FEAT 63332    Feature Number 15                   00000000 UI     ACME Company Number 3         
FEAT 63641    Feature Number 16                   00000000 UI     ACME Company Number 3         
FEAT 63730    Feature Number 17                   00000000 STX    ACME Company Number 5         
FEAT 63851    Feature Number 18                   00000000 SPC    ACME Company Number 6         
FEAT 64001    Feature Number 19                   00000000 UI     ACME Company Number 3         
FEAT 64583    Feature Number 20                   00000000 WB     Content Creator               
FEAT 65516    Feature Number 21                   00000000 UI     ACME Company Number 3         
FTTL 28298    12 000000 0000000000
PERF 28298    1855 12 12 000000 0000000000 00000000 00 0
PERF 28298    2130 12 12 000000 0000000000 00000000 00 0
FTTL 38674    11 000000 0000000000
PERF 38674    1700 11 11 000000 0000000000 00000000 00 0
PERF 38674    1415 11 11 000000 0000000000 00000000 00 0
FTTL 38674    21 000000 0000000000
PERF 38674    1925 21 21 000000 0000000000 00000000 00 0
FTTL 44455    15 000000 0000000000
PERF 44455    1920 15 15 000000 0000000000 00000000 00 0
PERF 44455    2220 15 15 000000 0000000000 00000000 00 0
PERF 44455    1015 15 15 000000 0000000000 00000000 00 0
FTTL 44455    23 000000 0000000000
PERF 44455    1955 23 23 000000 0000000000 00000000 00 0
FTTL 44455    24 000000 0000000000
PERF 44455    0025 24 24 000000 0000000000 00000000 00 0
PERF 44455    2130 24 24 000000 0000000000 00000000 00 0
FTTL 56623    17 000000 0000000000
PERF 56623    2215 17 17 000000 0000000000 00000000 00 0
PERF 56623    1650 17 17 000000 0000000000 00000000 00 0
FTTL 56623    27 000000 0000000000
PERF 56623    1530 27 27 000000 0000000000 00000000 00 0
PERF 56623    1910 27 27 000000 0000000000 00000000 00 0
PERF 56623    1235 27 27 000000 0000000000 00000000 00 0
PERF 56623    2205 27 27 000000 0000000000 00000000 00 0
FTTL 60077    19 000000 0000000000
PERF 60077    1510 19 19 000000 0000000000 00000000 00 0
PERF 60077    1730 19 19 000000 0000000000 00000000 00 0
PERF 60077    2005 19 19 000000 0000000000 00000000 00 0
FTTL 60077    28 000000 0000000000
PERF 60077    1740 28 28 000000 0000000000 00000000 00 0
PERF 60077    2220 28 28 000000 0000000000 00000000 00 0
FTTL 61918    18 000000 0000000000
PERF 61918    2200 18 18 000000 0000000000 00000000 00 0
PERF 61918    1500 18 18 000000 0000000000 00000000 00 0
PERF 61918    1200 18 18 000000 0000000000 00000000 00 0
PERF 61918    1830 18 18 000000 0000000000 00000000 00 0
FTTL 61918    29 000000 0000000000
PERF 61918    2155 29 29 000000 0000000000 00000000 00 0
FTTL 62033    24 000000 0000000000
PERF 62033    1425 24 24 000000 0000000000 00000000 00 0
PERF 62033    1825 24 24 000000 0000000000 00000000 00 0
PERF 62033    1015 24 24 000000 0000000000 00000000 00 0
PERF 62033    1015 05 24 000000 0000000000 00000000 00 0
FTTL 62033    26 000000 0000000000
PERF 62033    1025 26 26 000000 0000000000 00000000 00 0
FTTL 62049    12 000000 0000000000
PERF 62049    1220 12 12 000000 0000000000 00000000 00 0
PERF 62049    1510 12 12 000000 0000000000 00000000 00 0
FTTL 62049    20 000000 0000000000
PERF 62049    1930 20 20 000000 0000000000 00000000 00 0
FTTL 62049    22 000000 0000000000
PERF 62049    1610 22 22 000000 0000000000 00000000 00 0
FTTL 62228    14 000000 0000000000
PERF 62228    1045 14 14 000000 0000000000 00000000 00 0
PERF 62228    1510 14 14 000000 0000000000 00000000 00 0
PERF 62228    1930 14 14 000000 0000000000 00000000 00 0
FTTL 62228    21 000000 0000000000
PERF 62228    2220 21 21 000000 0000000000 00000000 00 0
PERF 62228    1615 21 21 000000 0000000000 00000000 00 0
FTTL 62229    22 000000 0000000000
PERF 62229    1255 22 22 000000 0000000000 00000000 00 0
FTTL 62229    26 000000 0000000000
PERF 62229    1505 26 26 000000 0000000000 00000000 00 0
FTTL 62229    30 000000 0000000000
PERF 62229    1900 30 30 000000 0000000000 00000000 00 0
PERF 62229    1400 30 30 000000 0000000000 00000000 00 0
PERF 62229    0800 30 30 000000 0000000000 00000000 00 0
PERF 62229    2200 30 30 000000 0000000000 00000000 00 0
FTTL 62234    09 000000 0000000000
PERF 62234    1925 09 09 000000 0000000000 00000000 00 0
PERF 62234    1215 09 09 000000 0000000000 00000000 00 0
PERF 62234    1500 09 09 000000 0000000000 00000000 00 0
FTTL 62234    19 000000 0000000000
PERF 62234    2300 19 19 000000 0000000000 00000000 00 0
FTTL 62234    26 000000 0000000000
PERF 62234    1900 26 26 000000 0000000000 00000000 00 0
FTTL 62235    11 000000 0000000000
PERF 62235    1945 11 11 000000 0000000000 00000000 00 0
PERF 62235    0000 11 11 000000 0000000000 00000000 00 0
FTTL 62246    08 000000 0000000000
PERF 62246    1510 08 08 000000 0000000000 00000000 00 0
PERF 62246    1940 08 08 000000 0000000000 00000000 00 0
PERF 62246    2220 08 08 000000 0000000000 00000000 00 0
FTTL 62246    19 000000 0000000000
PERF 62246    1210 19 19 000000 0000000000 00000000 00 0
FTTL 63329    09 000000 0000000000
PERF 63329    2220 09 09 000000 0000000000 00000000 00 0
FTTL 63332    17 000000 0000000000
PERF 63332    1940 17 17 000000 0000000000 00000000 00 0
PERF 63332    1355 17 17 000000 0000000000 00000000 00 0
FTTL 63332    23 000000 0000000000
PERF 63332    1515 23 23 000000 0000000000 00000000 00 0
PERF 63332    1735 23 23 000000 0000000000 00000000 00 0
FTTL 63641    15 000000 0000000000
PERF 63641    1450 15 15 000000 0000000000 00000000 00 0
PERF 63641    0100 15 15 000000 0000000000 00000000 00 0
FTTL 63641    25 000000 0000000000
PERF 63641    1620 25 25 000000 0000000000 00000000 00 0
PERF 63641    1320 25 25 000000 0000000000 00000000 00 0
FTTL 63641    29 000000 0000000000
PERF 63641    1440 29 29 000000 0000000000 00000000 00 0
FTTL 63730    10 000000 0000000000
PERF 63730    1755 10 10 000000 0000000000 00000000 00 0
PERF 63730    1755 05 10 000000 0000000000 00000000 00 0
FTTL 63730    16 000000 0000000000
PERF 63730    1440 16 16 000000 0000000000 00000000 00 0
PERF 63730    1700 16 16 000000 0000000000 00000000 00 0
FTTL 63730    22 000000 0000000000
PERF 63730    1905 22 22 000000 0000000000 00000000 00 0
PERF 63730    2135 22 22 000000 0000000000 00000000 00 0
FTTL 63730    26 000000 0000000000
PERF 63730    2155 26 26 000000 0000000000 00000000 00 0
FTTL 63730    29 000000 0000000000
PERF 63730    1000 29 29 000000 0000000000 00000000 00 0
FTTL 63851    06 000000 0000000000
PERF 63851    1505 06 06 000000 0000000000 00000000 00 0
PERF 63851    1005 06 06 000000 0000000000 00000000 00 0
PERF 63851    2005 06 06 000000 0000000000 00000000 00 0
FTTL 63851    20 000000 0000000000
PERF 63851    1230 20 20 000000 0000000000 00000000 00 0
FTTL 64001    10 000000 0000000000
PERF 64001    1000 10 10 000000 0000000000 00000000 00 0
PERF 64001    1500 10 10 000000 0000000000 00000000 00 0
PERF 64001    2010 10 10 000000 0000000000 00000000 00 0
FTTL 64001    29 000000 0000000000
PERF 64001    1845 29 29 000000 0000000000 00000000 00 0
FTTL 64583    07 000000 0000000000
PERF 64583    1200 07 07 000000 0000000000 00000000 00 0
PERF 64583    1455 07 07 000000 0000000000 00000000 00 0
FTTL 64583    16 000000 0000000000
PERF 64583    2225 16 16 000000 0000000000 00000000 00 0
PERF 64583    1920 16 16 000000 0000000000 00000000 00 0
PERF 64583    2225 05 16 000000 0000000000 00000000 00 0
FTTL 64583    20 000009 0000010296
PERF 64583    2220 20 20 000009 0000010296 00000000 00 0
GROS RR SEN  1P   01144 00000110 00000119 0009 0000 0000 2 0095 00000
GRSD RR SEN  1P   01144 00000110 00000119 0009 0000 0000 2 0095 00000
PERF 64583    1515 20 20 000000 0000000000 00000000 00 0
FTTL 64583    25 000000 0000000000
PERF 64583    1920 25 25 000000 0000000000 00000000 00 0
PERF 64583    2215 25 25 000000 0000000000 00000000 00 0
FTTL 65516    07 000000 0000000000
PERF 65516    1915 07 07 000000 0000000000 00000000 00 0
FTTL 65516    08 000000 0000000000
PERF 65516    0005 07 08 000000 0000000000 00000000 00 0
FTTL 65516    21 000000 0000000000
PERF 65516    1210 21 21 000000 0000000000 00000000 00 0
FTTL 65516    28 000000 0000000000
PERF 65516    1340 28 28 000000 0000000000 00000000 00 0
LEDG 03520100 0000000000 CONC. SALES TAX                    
LEDG 03721310 0000000000 ADVANCE TICKET SALES               
LEDG 03721315 -000010296 MATURED ADVANCE SALES              
LEDG 03721700 0000000000 ENT CARD REDEEMED - BOX            
LEDG 03722000 0000000000 ENT CARD OFFLINE - REDEEMED        
LEDG 05050100 0000010296 ADMISSION REVENUE                  
LEDG 05060200 0000000000 Do Not Use GIFT CERT. REDEEMED     
LEDG 07300300 0000000000 OVER/SHORT                         
LEDG 03727600 0000000000 Stubs Redemptions - Box            
LEDG 03520110 0000000000 Concession Disc - Tax              
LEDG 05100120 0000000000 Tax Exempt Revenue                 
LEDG 03530900 0000000000 SUBSCRIPTION FEE TAX               
LEDG 03530400 0000000000 LOYALTY PROGRAM TAX                
LEDG 03721550 0000000000 ADVANCE CONCESSION SALES           
LEDG 03721555 0000000000 MATURED CONCESSIONS                
LEDG 01511699 0000000000 A/R CC Aloha - Tips                
LEDG 03530199 0000000000 Ticket Disc Tax                    
LEDG 03530198 0000000000 Box Tax Credits                    
LEDG 00999999 0000000000 UNKNOWN G/L                        
SVST 0000010296 0000010296 0000000000
BOXO 0000000000 00000000 0000000000 00000000 0000000000 00000000
BOXC 0000000000 00000000 0000000000 00000000 0000000000 00000000
CSAL 0000000000 0000000000 0000000000 0000000000
KCON 0000000000 0000000000 0000000000 0000000000
RMOT 060 ABO60               
RMOT 061 ABO61               
RMOT 474 474 ACME Testing Co.
RMOT 475 475 ACME Testing Co.
RMOT 476 476 ACME Testing Co.
RMOT 477 477 ACME Testing Co.
RMOT 478 478 ACME Testing Co.
RMOT 479 479 ACME Testing Co.
RMOT 480 480 ACME Testing Co.
RMOT 481 481 ACME Testing Co.
RMOT 482 482 ACME Testing Co.
RMOT 483 483 ACME Testing Co.
RMOT 484 484 ACME Testing Co.
RMOT 485 485 ACME Testing Co.
RMOT 486 486 ACME Testing Co.
RMOT 487 487 ACME Testing Co.
RMOT 488 488 ACME Testing Co.
RMOT 489 489 ACME Testing Co.
RMOT 490 490 ACME Testing Co.
RMOT 491 491 ACME Testing Co.
RMOT 492 492 ACME Testing Co.
RMOT 493 493 ACME Testing Co.
RMOT 494 494 ACME Testing Co.
RMOT 495 495 ACME Testing Co.
RMOT 496 496 ACME Testing Co.
RMOT 497 497 ACME Testing Co.
RMOT 498 498 ACME Testing Co.
RMOT 499 499 ACME Testing Co.
RMOT 500 500 ACME Pouring Co.
RMOT 501 501 ACME Pouring Co.
RMOT 502 502 ACME Pouring Co.
RMOT 503 503 ACME Pouring Co.
RMOT 504 504 ACME Pouring Co.
RMOT 505 505 ACME Pouring Co.
RMOT 506 506 ACME Pouring Co.
RMOT 507 507 ACME Pouring Co.
RMOT 508 508 ACME Pouring Co.
RMOT 509 509 ACME Pouring Co.
RMOT 510 510 ACME Pouring Co.
RMOT 511 511 ACME Pouring Co.
RMOT 512 512 ACME Pouring Co.
RMOT 513 513 ACME Pouring Co.
RMOT 514 514 ACME Pouring Co.
RMOT 515 515 ACME Pouring Co.
RMOT 516 516 ACME Pouring Co.
RMOT 517 517 ACME Pouring Co.
RMOT 518 518 ACME Pouring Co.
RMOT 519 519 ACME Pouring Co.
RMOT 520 520 ACME Pouring Co.
RMOT 521 521 ACME Pouring Co.
RMOT 522 522 ACME Pouring Co.
RMOT 523 523 ACME Pouring Co.
RMOT 524 524 ACME Pouring Co.
RMOT 525 525 ACME Pouring Co.
RMOT 526 526 ACME Pouring Co.
RMOT 527 527 ACME Pouring Co.
RMOT 528 528 ACME Pouring Co.
RMOT 529 529 ACME Pouring Co.
RMOT 530 530 ACME Pouring Co.
RMOT 531 531 ACME Pouring Co.
RMOT 532 532 ACME Pouring Co.
RMOT 533 533 ACME Pouring Co.
RMOT 534 534 ACME Pouring Co.
RMOT 535 535 ACME Pouring Co.
RMOT 536 536 ACME Pouring Co.
RMOT 537 537 ACME Pouring Co.
RMOT 538 538 ACME Pouring Co.
RMOT 539 539 ACME Pouring Co.
RMOT 540 540 ACME Pouring Co.
RMOT 541 541 ACME Pouring Co.
RMOT 542 542 ACME Pouring Co.
RMOT 543 543 ACME Pouring Co.
RMOT 544 544 ACME Pouring Co.
RMOT 545 545 ACME Pouring Co.
RMOT 546 546 ACME Pouring Co.
RMOT 547 547 ACME Pouring Co.
RMOT 548 548 ACME Pouring Co.
RMOT 549 549 ACME Pouring Co.
RMOT 550 550 ACME Pouring Co.
RMOT 551 551 ACME Pouring Co.
RMOT 552 552 Hybrid Partner  
RMOT 553 553 Hybrid Partner  
RMOT 554 554 Hybrid Partner  
RMOT 555 555 Hybrid Partner  
RMOT 556 556 Hybrid Partner  
RMOT 557 557 Hybrid Partner  
RMOT 558 558 Hybrid Partner  
RMOT 559 559 Hybrid Partner  
RMOT 560 560 Hybrid Partner  
RMOT 561 561 Hybrid Partner  
RMOT 562 562 Hybrid Partner  
RMOT 563 563 Hybrid Partner  
RMOT 564 564 Hybrid Partner  
RMOT 565 565 Hybrid Partner  
RMOT 566 566 Hybrid Partner  
RMOT 567 567 Hybrid Partner  
RMOT 568 568 Hybrid Partner  
RMOT 569 569 Hybrid Partner  
RMOT 570 570 Hybrid Partner  
RMOT 571 571 Hybrid Partner  
RMOT 572 572 Hybrid Partner  
RMOT 573 573 Hybrid Partner  
RMOT 574 574 Hybrid Partner  
RMOT 575 575 Hybrid Partner  
RMOT 576 576 Hybrid Partner  
RMOT 577 577 Hybrid Partner  
RMOT 578 578 Hybrid Partner  
RMOT 579 579 Hybrid Partner  
RMOT 580 580 Hybrid Partner  
RMOT 581 581 Hybrid Partner  
RMOT 582 582 Hybrid Partner  
RMOT 583 583 Hybrid Partner  
RMOT 584 584 Hybrid Partner  
RMOT 585 585 Hybrid Partner  
RMOT 586 586 Hybrid Partner  
RMOT 587 587 Hybrid Partner  
RMOT 588 588 Hybrid Partner  
RMOT 589 589 Hybrid Partner  
RMOT 590 590 Coupon          
RMOT 591 591 Coupon          
RMOT 592 592 Coupon          
RMOT 593 593 Coupon          
RMOT 594 594 Coupon          
RMOT 595 595 Coupon          
RMOT 596 596 Coupon          
RMOT 597 597 Coupon          
RMOT 598 598 Coupon          
RMOT 599 599 Coupon          
RMOT 600 600 ACME Mobile Appl
RMOT 601 601 ACME Mobile Appl
RMOT 602 602 ACME Mobile Appl
RMOT 603 603 ACME Mobile Appl
RMOT 604 604 ACME Mobile Appl
RMOT 605 605 ACME Mobile Appl
RMOT 606 606 ACME Mobile Appl
RMOT 607 607 ACME Mobile Appl
RMOT 608 608 ACME Mobile Appl
RMOT 609 609 ACME Mobile Appl
RMOT 610 610 ACME Mobile Appl
RMOT 611 611 ACME Mobile Appl
RMOT 612 612 ACME Mobile Appl
RMOT 613 613 ACME Mobile Appl
RMOT 614 614 ACME Mobile Appl
RMOT 615 615 ACME Mobile Appl
RMOT 616 616 ACME Mobile Appl
RMOT 617 617 ACME Mobile Appl
RMOT 618 618 ACME Mobile Appl
RMOT 619 619 ACME Mobile Appl
RMOT 620 620 ACME Mobile Appl
RMOT 621 621 ACME Mobile Appl
RMOT 622 622 ACME Mobile Appl
RMOT 623 623 ACME Mobile Appl
RMOT 624 624 ACME Mobile Appl
RMOT 625 625 ACME Mobile Appl
RMOT 626 626 ACME Mobile Appl
RMOT 627 627 ACME Mobile Appl
RMOT 628 628 ACME Mobile Appl
RMOT 629 629 ACME Mobile Appl
RMOT 630 630 ACME Mobile Appl
RMOT 631 631 ACME Mobile Appl
RMOT 632 632 ACME Mobile Appl
RMOT 633 633 ACME Mobile Appl
RMOT 634 634 ACME Mobile Appl
RMOT 635 635 ACME Mobile Appl
RMOT 636 636 ACME Mobile Appl
RMOT 637 637 ACME Mobile Appl
RMOT 638 638 ACME Mobile Appl
RMOT 639 639 ACME Mobile Appl
RMOT 640 640 ACME Mobile Appl
RMOT 641 641 ACME Mobile Appl
RMOT 642 642 ACME Mobile Appl
RMOT 643 643 ACME Mobile Appl
RMOT 644 644 ACME Mobile Appl
RMOT 645 645 ACME Mobile Appl
RMOT 646 646 ACME Mobile Appl
RMOT 647 647 ACME Mobile Appl
RMOT 648 648 ACME Mobile Appl
RMOT 649 649 ACME Mobile Appl
RMOT 650 650 ACME Mobile Appl
RMOT 651 651 ACME Mobile Appl
RMOT 652 652 ACME Mobile Appl
RMOT 653 653 ACME Mobile Appl
RMOT 654 654 ACME Mobile Appl
RMOT 655 655 ACME Mobile Appl
RMOT 656 656 ACME Mobile Appl
RMOT 657 657 ACME Mobile Appl
RMOT 658 658 ACME Mobile Appl
RMOT 659 659 ACME Mobile Appl
RMOT 660 660 ACME Mobile Appl
RMOT 661 661 ACME Mobile Appl
RMOT 662 662 ACME Mobile Appl
RMOT 663 663 ACME Mobile Appl
RMOT 664 664 ACME Mobile Appl
RMOT 665 665 ACME Mobile Appl
RMOT 666 666 ACME Mobile Appl
RMOT 667 667 ACME Mobile Appl
RMOT 668 668 ACME Mobile Appl
RMOT 669 669 ACME Mobile Appl
RMOT 670 670 ACME Mobile Appl
RMOT 671 671 ACME Mobile Appl
RMOT 672 672 ACME Mobile Appl
RMOT 673 673 ACME Mobile Appl
RMOT 674 674 ACME Mobile Appl
RMOT 675 675 ACME Mobile Appl
RMOT 676 676 ACME Mobile Appl
RMOT 677 677 ACME Mobile Appl
RMOT 678 678 ACME Mobile Appl
RMOT 679 679 ACME Mobile Appl
RMOT 680 680 ACME Mobile Appl
RMOT 681 681 ACME Mobile Appl
RMOT 682 682 ACME Mobile Appl
RMOT 683 683 ACME Mobile Appl
RMOT 684 684 ACME Mobile Appl
RMOT 685 685 ACME Mobile Appl
RMOT 686 686 ACME Mobile Appl
RMOT 687 687 ACME Mobile Appl
RMOT 688 688 ACME Mobile Appl
RMOT 689 689 ACME Mobile Appl
RMOT 690 690 ACME Mobile Appl
RMOT 691 691 ACME Mobile Appl
RMOT 692 692 ACME Mobile Appl
RMOT 693 693 ACME Mobile Appl
RMOT 694 694 ACME Mobile Appl
RMOT 695 695 ACME Mobile Appl
RMOT 696 696 ACME Mobile Appl
RMOT 697 697 ACME Mobile Appl
RMOT 698 698 ACME Mobile Appl
RMOT 699 699 ACME Mobile Appl
RMOT 700 700 ACME COM        
RMOT 701 701 ACME COM        
RMOT 702 702 ACME COM        
RMOT 703 703 ACME COM        
RMOT 704 704 ACME COM        
RMOT 705 705 ACME COM        
RMOT 706 706 ACME COM        
RMOT 707 707 ACME COM        
RMOT 708 708 ACME COM        
RMOT 709 709 ACME COM        
RMOT 710 710 ACME COM        
RMOT 711 711 ACME COM        
RMOT 712 712 ACME COM        
RMOT 713 713 ACME COM        
RMOT 714 714 ACME COM        
RMOT 715 715 ACME COM        
RMOT 716 716 ACME COM        
RMOT 717 717 ACME COM        
RMOT 718 718 ACME COM        
RMOT 719 719 ACME COM        
RMOT 720 720 ACME COM        
RMOT 721 721 ACME COM        
RMOT 722 722 ACME COM        
RMOT 723 723 ACME COM        
RMOT 724 724 ACME COM        
RMOT 725 725 ACME Testing Co.
RMOT 726 726 ACME Testing Co.
RMOT 727 727 ACME Testing Co.
RMOT 728 728 ACME Testing Co.
RMOT 729 729 ACME Testing Co.
RMOT 730 730 ACME Testing Co.
RMOT 731 731 ACME Testing Co.
RMOT 732 732 ACME Testing Co.
RMOT 733 733 ACME Testing Co.
RMOT 734 734 ACME Testing Co.
RMOT 735 735 ACME Testing Co.
RMOT 736 736 ACME Testing Co.
RMOT 737 737 ACME Testing Co.
RMOT 738 738 ACME Testing Co.
RMOT 739 739 ACME Testing Co.
RMOT 740 740 ACME Testing Co.
RMOT 741 741 ACME Testing Co.
RMOT 742 742 ACME Testing Co.
RMOT 743 743 ACME Testing Co.
RMOT 744 744 ACME Testing Co.
RMOT 745 745 ACME Testing Co.
RMOT 746 746 ACME Testing Co.
RMOT 747 747 ACME Testing Co.
RMOT 748 748 ACME Testing Co.
RMOT 749 749 ACME Testing Co.
RMOT 750 750 ACME Mobile Appl
RMOT 751 751 ACME Mobile Appl
RMOT 752 752 ACME Mobile Appl
RMOT 753 753 ACME Mobile Appl
RMOT 754 754 ACME Mobile Appl
RMOT 755 755 ACME Mobile Appl
RMOT 756 756 ACME Mobile Appl
RMOT 757 757 ACME Mobile Appl
RMOT 758 758 ACME Mobile Appl
RMOT 759 759 ACME Mobile Appl
RMOT 760 760 ACME Mobile Appl
RMOT 761 761 ACME Mobile Appl
RMOT 762 762 ACME Mobile Appl
RMOT 763 763 ACME Mobile Appl
RMOT 764 764 ACME Mobile Appl
RMOT 765 765 ACME Mobile Appl
RMOT 766 766 ACME Mobile Appl
RMOT 767 767 ACME Mobile Appl
RMOT 768 768 ACME Mobile Appl
RMOT 769 769 ACME Mobile Appl
RMOT 770 770 ACME Mobile Appl
RMOT 771 771 ACME Mobile Appl
RMOT 772 772 ACME Mobile Appl
RMOT 773 773 ACME Mobile Appl
RMOT 774 774 ACME Mobile Appl
RMOT 775 775 ACME Mobile Appl
RMOT 776 776 ACME Mobile Appl
RMOT 777 777 ACME Mobile Appl
RMOT 778 778 ACME Mobile Appl
RMOT 779 779 ACME Mobile Appl
RMOT 780 780 ACME Mobile Appl
RMOT 781 781 ACME Mobile Appl
RMOT 782 782 ACME Mobile Appl
RMOT 783 783 ACME Mobile Appl
RMOT 784 784 ACME Mobile Appl
RMOT 785 785 ACME Mobile Appl
RMOT 786 786 ACME Mobile Appl
RMOT 787 787 ACME Mobile Appl
RMOT 788 788 ACME Mobile Appl
RMOT 789 789 ACME Mobile Appl
RMOT 790 790 ACME Mobile Appl
RMOT 791 791 ACME Mobile Appl
RMOT 792 792 ACME Mobile Appl
RMOT 793 793 ACME Mobile Appl
RMOT 794 794 ACME Mobile Appl
RMOT 795 795 ACME Mobile Appl
RMOT 796 796 ACME Mobile Appl
RMOT 797 797 ACME Mobile Appl
RMOT 798 798 ACME Mobile Appl
RMOT 799 799 ACME Mobile Appl
RMOT 800 800 Another Partner 
RMOT 801 801 Another Partner 
RMOT 802 802 Another Partner 
RMOT 803 803 Another Partner 
RMOT 804 804 Another Partner 
RMOT 805 805 Another Partner 
RMOT 806 806 Another Partner 
RMOT 807 807 Another Partner 
RMOT 808 808 Another Partner 
RMOT 809 809 Another Partner 
RMOT 810 810 Another Partner 
RMOT 811 811 Another Partner 
RMOT 812 812 Another Partner 
RMOT 813 813 Another Partner 
RMOT 814 814 Another Partner 
RMOT 815 815 Another Partner 
RMOT 816 816 Another Partner 
RMOT 817 817 Another Partner 
RMOT 818 818 Another Partner 
RMOT 819 819 Another Partner 
RMOT 820 820 Another Partner 
RMOT 821 821 Another Partner 
RMOT 822 822 Another Partner 
RMOT 823 823 Another Partner 
RMOT 824 824 Another Partner 
RMOT 825 825 Another Partner 
RMOT 826 826 Another Partner 
RMOT 827 827 Another Partner 
RMOT 828 828 Another Partner 
RMOT 829 829 Another Partner 
RMOT 830 830 Another Partner 
RMOT 831 831 Another Partner 
RMOT 832 832 Another Partner 
RMOT 833 833 Another Partner 
RMOT 834 834 Another Partner 
RMOT 835 835 Another Partner 
RMOT 836 836 Another Partner 
RMOT 837 837 Another Partner 
RMOT 838 838 Another Partner 
RMOT 839 839 Another Partner 
RMOT 840 840 Another Partner 
RMOT 841 841 Another Partner 
RMOT 842 842 Another Partner 
RMOT 843 843 Another Partner 
RMOT 844 844 Another Partner 
RMOT 845 845 Another Partner 
RMOT 846 846 Another Partner 
RMOT 847 847 Another Partner 
RMOT 848 848 Another Partner 
RMOT 849 849 Another Partner 
RMOT 850 850 Another Partner 
RMOT 851 851 Another Partner 
RMOT 852 852 Another Partner 
RMOT 853 853 Another Partner 
RMOT 854 854 Another Partner 
RMOT 855 855 Another Partner 
RMOT 856 856 Another Partner 
RMOT 857 857 Another Partner 
RMOT 858 858 Another Partner 
RMOT 859 859 Another Partner 
RMOT 860 860 Another Partner 
RMOT 861 861 Another Partner 
RMOT 862 862 Another Partner 
RMOT 863 863 Another Partner 
RMOT 864 864 Another Partner 
RMOT 865 865 Another Partner 
RMOT 866 866 Another Partner 
RMOT 867 867 Another Partner 
RMOT 868 868 Another Partner 
RMOT 869 869 Another Partner 
RMOT 870 870 Another Partner 
RMOT 871 871 Another Partner 
RMOT 872 872 Another Partner 
RMOT 873 873 Another Partner 
RMOT 874 874 Another Partner 
RMOT 875 875 Another Partner 
RMOT 876 876 Another Partner 
RMOT 877 877 Another Partner 
RMOT 878 878 Another Partner 
RMOT 879 879 Another Partner 
RMOT 880 880 Another Partner 
RMOT 881 881 Another Partner 
RMOT 882 882 Another Partner 
RMOT 883 883 Another Partner 
RMOT 884 884 Another Partner 
RMOT 885 885 Another Partner 
RMOT 886 886 Another Partner 
RMOT 887 887 Another Partner 
RMOT 888 888 Another Partner 
RMOT 889 889 Another Partner 
RMOT 890 890 Another Partner 
RMOT 891 891 Another Partner 
RMOT 892 892 Another Partner 
RMOT 893 893 Another Partner 
RMOT 894 894 Another Partner 
RMOT 895 895 Another Partner 
RMOT 896 896 Another Partner 
RMOT 897 897 Another Partner 
RMOT 898 898 Another Partner 
RMOT 899 899 Another Partner 
RMOT 900 900 ACME Testing Co.
RMOT 901 901 ACME Testing Co.
RMOT 902 902 ACME Testing Co.
RMOT 903 903 ACME Testing Co.
RMOT 904 904 ACME Testing Co.
RMOT 905 905 ACME Testing Co.
RMOT 906 906 ACME Testing Co.
RMOT 907 907 ACME Testing Co.
RMOT 908 908 ACME Testing Co.
RMOT 909 909 ACME Testing Co.
RMOT 910 910 ACME Testing Co.
RMOT 911 911 ACME Testing Co.
RMOT 912 912 ACME Testing Co.
RMOT 913 913 ACME Testing Co.
RMOT 914 914 ACME Testing Co.
RMOT 915 915 ACME Testing Co.
RMOT 916 916 ACME Testing Co.
RMOT 917 917 ACME Testing Co.
RMOT 918 918 ACME Testing Co.
RMOT 919 919 ACME Testing Co.
RMOT 920 920 ACME Testing Co.
RMOT 921 921 ACME Testing Co.
RMOT 922 922 ACME Testing Co.
RMOT 923 923 ACME Testing Co.
RMOT 924 924 ACME Testing Co.
RMOT 925 925 ACME Testing Co.
RMOT 926 926 ACME Testing Co.
RMOT 927 927 ACME Testing Co.
RMOT 928 928 ACME Testing Co.
RMOT 929 929 ACME Testing Co.
RMOT 930 930 ACME Testing Co.
RMOT 931 931 ACME Testing Co.
RMOT 932 932 ACME Testing Co.
RMOT 933 933 ACME Testing Co.
RMOT 934 934 ACME Testing Co.
RMOT 935 935 ACME Testing Co.
RMOT 936 936 ACME Testing Co.
RMOT 937 937 ACME Testing Co.
RMOT 938 938 ACME Testing Co.
RMOT 939 939 ACME Testing Co.
RMOT 940 940 ACME Testing Co.
RMOT 941 941 ACME Testing Co.
RMOT 942 942 ACME Testing Co.
RMOT 943 943 ACME Testing Co.
RMOT 944 944 ACME Testing Co.
RMOT 945 945 ACME Testing Co.
RMOT 946 946 ACME Testing Co.
RMOT 947 947 ACME Testing Co.
RMOT 948 948 ACME Testing Co.
RMOT 949 949 ACME Testing Co.
RMOT 950 950 ACME Testing Co.
RMOT 951 951 ACME Testing Co.
RMOT 952 952 ACME Testing Co.
RMOT 953 953 ACME Testing Co.
RMOT 954 954 ACME Testing Co.
RMOT 955 955 ACME Testing Co.
RMOT 956 956 ACME Testing Co.
RMOT 957 957 ACME Testing Co.
RMOT 958 958 ACME Testing Co.
RMOT 959 959 ACME Testing Co.
RMOT 960 960 ACME Testing Co.
RMOT 961 961 ACME Testing Co.
RMOT 962 962 ACME Testing Co.
RMOT 963 963 ACME Testing Co.
RMOT 964 964 ACME Testing Co.
RMOT 965 965 ACME Testing Co.
RMOT 966 966 ACME Testing Co.
RMOT 967 967 ACME Testing Co.
RMOT 968 968 ACME Testing Co.
RMOT 969 969 ACME Testing Co.
RMOT 970 970 ACME Testing Co.
RMOT 971 971 ACME Testing Co.
RMOT 972 972 ACME Testing Co.
RMOT 973 973 ACME Testing Co.
RMOT 974 974 ACME Testing Co.
RMOT 975 975 ACME Testing Co.
RMOT 976 976 ACME Testing Co.
RMOT 977 977 ACME Testing Co.
RMOT 978 978 ACME Testing Co.
RMOT 979 979 ACME Testing Co.
RMOT 980 980 ACME Testing Co.
RMOT 981 981 ACME Testing Co.
RMOT 982 982 ACME Testing Co.
RMOT 983 983 ACME Testing Co.
RMOT 984 984 ACME Testing Co.
RMOT 985 985 ACME Testing Co.
RMOT 986 986 ACME Testing Co.
RMOT 987 987 ACME Testing Co.
RMOT 988 988 ACME Testing Co.
RMOT 989 989 ACME Testing Co.
RMOT 990 990 ACME Testing Co.
RMOT 991 991 ACME Testing Co.
RMOT 992 992 ACME Testing Co.
RMOT 993 993 ACME Testing Co.
RMOT 994 994 ACME Testing Co.
RMOT 995 995 ACME Testing Co.
RMOT 996 996 ACME Testing Co.
RMOT 997 997 ACME Testing Co.
RMOT 998 998 ACME Testing Co.
RMOT 999 999 ACME Testing Co.
FET2 64583    Fantastic                          
GRS2 RR SEN  1P   00749 0009 0000 0000 1 0000
TRCT 000000 000000 000000 000000 000000 000000
CHCK 0000000000
RECS 0732 000732
MSAL 20190626             
0 Likes

#7

You can preserve whitespace by wrapping the file contents in a fenced code block:

```
my    text     with     whitepace
```
0 Likes

#8

Do you specifically need column accuracy or would existing whitespace to separate the values be enough? Both are possible, the latter is just a little bit easier.

Also, are the column numbers exactly like thut with trailing whitespace or can the last item be shorter (it is in your example). Are fields required to be separated by a space character?

1 Like

#9

You only asked if it was possible, I thought you’d then just go and do it confident in that knowledge.

It’s really not very difficult at all, your syntax is almost trivial compared to most programming languages.

All you really have to do it is put together some regular expressions that match the elements in your syntax and then put them together according to the rules of the Sublime Text syntax definition file. It’s basically the same no matter what the language and you should have a look at existing examples and tutorials for the syntax definition files and regular expressions to learn about them.

0 Likes

#10

Column accuracy is best for the format. A while a white space might separate 2 values, it could also exist within a value. So looking at the FEAT section “Feature Number 1” is all the same element.

0 Likes

#11

The regex isn’t that piece that I’m having difficulty with. I can write that to find the element, but how afterwords I say take the next 10 characters and color code that, and then the next 23 after that, and then the next 5 after that. I don’t see those examples anywhere.

0 Likes

#12

Example:

%YAML 1.2
---
name: Fixed width test
scope: source.test.fixed-width
contexts:
  main:
    - match: '^(FEAT)'
      captures:
        1: storage
      push:
        - string-30
        - space
        - code-6
        - space
        - int-8
        - space
        - string-35
        - space
        - int-8
        - space

  pop-on-eol:
    - match: $
      pop: true

  space:
    - include: pop-on-eol
    - match: ' '
      scope: punctuation.separator.field.fixed-width
      pop: true
    - match: .
      scope: invalid.illegal.fixed-width
      pop: true

  int-8:
    - include: pop-on-eol
    - match: (?=(\d+)\s*(.*)).{8}
      captures:
        1: constant.numeric.fixed-width
        2: invalid.illegal.fixed-width
      pop: true

  string-35:
    - include: pop-on-eol
    - match: .{35}
      scope: string.unquoted.fixed-width
      pop: true

  string-30:
    - include: pop-on-eol
    - match: .{30}
      scope: string.unquoted.fixed-width
      pop: true

  code-6:
    - include: pop-on-eol
    - match: (?=(WB|UI)?\s*(.*)).{6}
      captures:
        1: constant.other.fixed-width
        2: invalid.illegal.fixed-width
      pop: true

This will highlight FEAT lines.

Some explanation of the regex (?=(\d+)\s*(.*)).{8} may be in order. The regex consists of an unbounded lookahead with captures followed by a bounded “main” part. The total length of the match will be 8 characters exactly, but the lookahead may look well beyond that. However, even if the lookahead captures match more than 8 characters, Sublime will only highlight the first 8. This lets you use the .{8} part to set the length of the match while using lookaheads to capture variable-length parts of the match.

If you have questions about the above syntax, please ask; it’s a bit unorthodox.

3 Likes

#13

So I added a new section (GROS) to the syntax. My next rpblem is that it seems it is color coding based on data type? So all of the digits are purple.

%YAML 1.2
---
name: Fixed width test
scope: source.test.fixed-width
contexts:
  main:
    - match: '^(FEAT)'
      captures:
        1: storage
      push:
        - string-30
        - space
        - code-6
        - space
        - int-8
        - space
        - string-35
        - space
        - int-8
        - space
    - match: '^(GROS)'
      captures:
        1: storage
      push:
        - char-5
        - space
        - int-4
        - space
        - int-1
        - space
        - int-4
        - space
        - int-4
        - space
        - int-4
        - space
        - int-8
        - space
        - int-8
        - space
        - char-5
        - space
        - string-4
        - space
        - string-7
        - space

  pop-on-eol:
    - match: $
      pop: true

  space:
    - include: pop-on-eol
    - match: ' '
      scope: punctuation.separator.field.fixed-width
      pop: true
    - match: .
      scope: invalid.illegal.fixed-width
      pop: true

  int-8:
    - include: pop-on-eol
    - match: (?=(\d+)\s*(.*)).{8}
      captures:
        1: constant.numeric.fixed-width
        2: invalid.illegal.fixed-width
      pop: true

  char-5:
    - include: pop-on-eol
    - match: (?=(\d+)\s*(.*)).{5}
      captures:
        1: constant.numeric.fixed-width
        2: invalid.illegal.fixed-width
      pop: true

  int-4:
    - include: pop-on-eol
    - match: (?=(\d+)\s*(.*)).{4}
      captures:
        1: constant.numeric.fixed-width
        2: invalid.illegal.fixed-width
      pop: true

  int-1:
    - include: pop-on-eol
    - match: (?=(\d+)\s*(.*)).{1}
      captures:
        1: constant.numeric.fixed-width
        2: invalid.illegal.fixed-width
      pop: true

  string-35:
    - include: pop-on-eol
    - match: .{35}
      scope: string.unquoted.fixed-width
      pop: true

  string-7:
    - include: pop-on-eol
    - match: .{7}
      scope: string.unquoted.fixed-width
      pop: true

  string-4:
    - include: pop-on-eol
    - match: .{4}
      scope: string.unquoted.fixed-width
      pop: true

  string-30:
    - include: pop-on-eol
    - match: .{30}
      scope: string.unquoted.fixed-width
      pop: true

  code-6:
    - include: pop-on-eol
    - match: (?=(\w\s)?\s*(.*)).{6}
      captures:
        1: constant.other.fixed-width
        2: invalid.illegal.fixed-width
      pop: true

image

How would I force each section to be a different color?

0 Likes

#14

image

spec if needed

0 Likes

#15

it is color coding based on data type?

Yes. You can see that the int-n context apply the scope constant.numeric. Your color scheme then colors text with that scope purple. To color each field differently, you must apply different scopes.

Sublime’s highlighting system is meant to color text based on the sort of thing the text represents (e.g. a number or a string). It sounds like the highlighting you want may not be compatible with that approach. If so, that isn’t a problem — but it does mean that you might have to write the syntax definition a bit differently than usual. For instance, you could use scopes with names like meta.column.1, and modify your color scheme to color these scopes in particular ways.

1 Like

#16

@ThomSmith you are a wizard!!! Thank you. We will be able to use this in a lot of different areas!! I appreciate everyone’s help!

0 Likes

#17

This would also be a good candidate for YAMLMacros to generate most of the boiler-blate, since the majority of the contexts are very similar. With the proper macros, you could write highlighting for a command like follows:

!command
  code: GROS
  fields:
    - {size: 7, type: str}
    - {size: 4, type: str}
    - {size: 5, type: int}

But that’s for when you are deep into syntax definitions, like Thomas (who developed YAMLMacros).

2 Likes