Skip to main content

Notifications

Finance | Project Operations, Human Resources, ...
Suggested answer

How to set fixed widths file format

(0) ShareShare
ReportReport
Posted on by 171
Hi Team.
 
Using below link i have generated the .txt file.
 
Currently i am getting data like below.
////
 
Expected Data;-
Each column have fixed width and data should come based on fixed width.
Like below
////
 
  • Martin Dráb Profile Picture
    Martin Dráb 230,817 Most Valuable Professional on at
    How to set fixed widths file format in D365FO
    Has your question been answered? If so, please verify the answer. If not, please tell us what else you need for us before it can be considered answered.
  • Suggested answer
    Martin Dráb Profile Picture
    Martin Dráb 230,817 Most Valuable Professional on at
    How to set fixed widths file format in D365FO
    There is nothing like a number with spaces. It must be a string.
     
    You already know how to deal with strings, therefore the solution is obvious: convert numbers to strings and use strLFix() (or strRFix()).
  • CU21091228-0 Profile Picture
    CU21091228-0 171 on at
    How to set fixed widths file format in D365FO
    for sting value will use 
    strLFix
    Please let me know for integer value and real value what should i use?
  • Martin Dráb Profile Picture
    Martin Dráb 230,817 Most Valuable Professional on at
    How to set fixed widths file format in D365FO
    Note that F&O comes with a data management framework, which supports export to both delimited and fixed-width text files.
     
    I also successfully used FixedWidthParserWriter when dealing with fixed-width text files in Azure Functions.
  • Suggested answer
    Martin Dráb Profile Picture
    Martin Dráb 230,817 Most Valuable Professional on at
    How to set fixed widths file format in D365FO
    I see it's a continuation of your other questions about TextStreamIo.
     
    Simply add extra spaces to values before writing them to TextStreamIo. For example:
    strLFix('sdfsdf,', 13)

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,965 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 230,817 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans