Close Menu
    DevStackTipsDevStackTips
    • Home
    • News & Updates
      1. Tech & Work
      2. View All

      The Case For Minimal WordPress Setups: A Contrarian View On Theme Frameworks

      June 4, 2025

      How To Fix Largest Contentful Paint Issues With Subpart Analysis

      June 4, 2025

      How To Prevent WordPress SQL Injection Attacks

      June 4, 2025

      Smashing Animations Part 4: Optimising SVGs

      June 4, 2025

      I test AI tools for a living. Here are 3 image generators I actually use and how

      June 4, 2025

      The world’s smallest 65W USB-C charger is my latest travel essential

      June 4, 2025

      This Spotlight alternative for Mac is my secret weapon for AI-powered search

      June 4, 2025

      Tech prophet Mary Meeker just dropped a massive report on AI trends – here’s your TL;DR

      June 4, 2025
    • Development
      1. Algorithms & Data Structures
      2. Artificial Intelligence
      3. Back-End Development
      4. Databases
      5. Front-End Development
      6. Libraries & Frameworks
      7. Machine Learning
      8. Security
      9. Software Engineering
      10. Tools & IDEs
      11. Web Design
      12. Web Development
      13. Web Security
      14. Programming Languages
        • PHP
        • JavaScript
      Featured

      Beyond AEM: How Adobe Sensei Powers the Full Enterprise Experience

      June 4, 2025
      Recent

      Beyond AEM: How Adobe Sensei Powers the Full Enterprise Experience

      June 4, 2025

      Simplify Negative Relation Queries with Laravel’s whereDoesntHaveRelation Methods

      June 4, 2025

      Cast Model Properties to a Uri Instance in 12.17

      June 4, 2025
    • Operating Systems
      1. Windows
      2. Linux
      3. macOS
      Featured

      My Favorite Obsidian Plugins and Their Hidden Settings

      June 4, 2025
      Recent

      My Favorite Obsidian Plugins and Their Hidden Settings

      June 4, 2025

      Rilasciata /e/OS 3.0: Nuova Vita per Android Senza Google, Più Privacy e Controllo per l’Utente

      June 4, 2025

      Rilasciata Oracle Linux 9.6: Scopri le Novità e i Miglioramenti nella Sicurezza e nelle Prestazioni

      June 4, 2025
    • Learning Resources
      • Books
      • Cheatsheets
      • Tutorials & Guides
    Home»Development»Automating verification of text file contents format?

    Automating verification of text file contents format?

    February 13, 2025
    01FILENO00012 CRD        20250212015407CRD TEXTFIL1 DAT INTERNALD & NUMBER1              00320250211                                            |
    

    This is one record/line in my text file. I am trying to verify if the format of file is correct.
    Now, the record should have exact number of whitespaces and some words never change.

    Now, “01FILENO000012”, “CRD” , “TEXTFILE1” are static and never change … so i want to match these exactly in brackets?

    /           System.out.println("Length of line is: " + line.length() + " " + line);
                if (line.startsWith("01") && line.trim().matches(
                        "(01FILENO00012)\s+(CRD)\s{8}[0-9]{14}(CRD)\s+(TEXTFIL1)\s+(DAT)\s+(INTERNALD)\s+(&)\s+(NUMBER1)\s{14}[0-9]{11}\s{44}[|]")) {
                    {
                        System.out.println("This is header record: " + line + " and its has correct format");
                    }
    

    Please help me write correct Java regex so that i can automate file format verification?

    Source: Read More

    Facebook Twitter Reddit Email Copy Link
    Previous ArticleCodeSOD: Double Checking
    Next Article What is shakeout testing?

    Related Posts

    Common Vulnerabilities and Exposures (CVEs)

    CVE-2025-49223 – Billboard.js Prototype Pollution Vulnerability

    June 4, 2025
    Common Vulnerabilities and Exposures (CVEs)

    CVE-2025-5593 – FreeFloat FTP Server Buffer Overflow Vulnerability

    June 4, 2025
    Leave A Reply Cancel Reply

    Hostinger

    Continue Reading

    CVE-2025-32818 impacts SonicOS SSLVPN

    Security

    CVE-2025-4499 – Simple Hospital Management System Buffer Overflow

    Common Vulnerabilities and Exposures (CVEs)

    Unlocking Creativity in UX Research

    Development

    TikTok rolls out a new Security Checkup tool. Here’s how it works

    News & Updates

    Highlights

    CVE-2025-48798 – GIMP XCF Image File Use-After-Free Vulnerability

    May 27, 2025

    CVE ID : CVE-2025-48798

    Published : May 27, 2025, 2:15 p.m. | 2 hours, 43 minutes ago

    Description : A flaw was found in GIMP when processing XCF image files. If a user opens one of these image files that has been specially crafted by an attacker, GIMP can be tricked into making serious memory errors, potentially leading to crashes and causing use-after-free issues.

    Severity: 7.3 | HIGH

    Visit the link for more details, such as CVSS details, affected products, timeline, and more…

    Build agentic AI solutions with DeepSeek-R1, CrewAI, and Amazon SageMaker AI

    February 10, 2025

    CVE-2025-3580 – Grafana Server Administrator Account Deletion Vulnerability

    May 23, 2025

    3 reasons you should not buy the Surface Pro 11 or Surface Laptop 7 with Intel (and 1 reason you should)

    February 19, 2025
    © DevStackTips 2025. All rights reserved.
    • Contact
    • Privacy Policy

    Type above and press Enter to search. Press Esc to cancel.