web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Suggested Answer

How to read CSV position file

(0) ShareShare
ReportReport
Posted on by 536

Hi,

If let's say we have a text file with those 2 lines:

AB11  234

CD12  567

XA1245789

This means the max position here is 9 ( there are spaces in the middle for the 2 lines)

i need to upload this file, and after uploading it, i need to read it like this:

Let's say first 2 positions means name

After it, 4 positions mean number

And last 3 positions means specialNumber

I want to read it by printing this:

Name: AB

Number: 12

Special number:234

Name: CD

Number: 12

Special number:567

Name: XA

Number: 1245

Special number:789

How can i do the reading?

I have the same question (0)
  • Martin Dráb Profile Picture
    238,782 Most Valuable Professional on at

    Please give us some context of your question.

  • DELDYN Profile Picture
    536 on at

    Hi Martin,

    I edited the question..can you please help?

  • Suggested answer
    SARFARAZ AHMED MUFTI Profile Picture
    32 on at

    function readTextFile() {

       file.open("filename.txt", "r");  // Open the file for reading

       while (!file.eof()) {  // Read until the end of the file

           string line = file.readLine();  // Read a line from the file

           string name = line.substring(0, 2);  // Extract the name

           string number = line.substring(2, 6);  // Extract the number

           string specialNumber = line.substring(6, 9);  // Extract the special number

           // Print the extracted information

           print("Name: " + name);

           print("Number: " + number);

           print("Special number: " + specialNumber);

           print();

       }

       file.close();  // Close the file

    }

    readTextFile();  // Call the function to read and process the text file

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 514 Super User 2026 Season 1

#2
Giorgio Bonacorsi Profile Picture

Giorgio Bonacorsi 390

#3
Adis Profile Picture

Adis 266 Super User 2026 Season 1

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans