Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6945315
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T13:25:13+00:00 2026-05-27T13:25:13+00:00

I have successfully written a vhdl code to read and write a file. Basically

  • 0

I have successfully written a vhdl code to read and write a file. Basically I read a file, process the data in the file and write the results to another file.
Now I want to extend my program to reading multiple testcases. For example the data will be available in different files named 1.txt, 2.txt, and so on till 100.txt.
I want to use a loop to read the data from the files one by one and write the output to different files. Can any one help?

type i1 is file of character;                       
file f1 : i1 open READ_MODE is "1.txt";

this is the type of code i have used for reading the file. How to extend it for array of files?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T13:25:14+00:00Added an answer on May 27, 2026 at 1:25 pm

    My blog here http://parallelpoints.com/node/66/ shows how to open files from within a function and read the data.

    You can pass filenames as string type to a function and use text files:

    file file_variable : text;
    

    and…

    file_open(file_variable, filename, read_mode);
    

    to open it.

    Beware, if you are reading binary files, different simulators behave in different ways. Modelsim will do what you (probably) expect. I’ve had GHDL fall over when an EOF character is read. And Xilinx’s simulator expects a special header on the file!

    It’s most portable to stick to pure text, even if you have to pre-process it.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have successfully written code to dynamically union the results of a simple select
I have written a VHDL code which implements the functionality of a PWM Controller.
I have successfully been able to transform a simple xml file with data to
I have my program written in C++ and it is can be successfully compiled
I have written a google visualization treemap wrapper for GWT. I can successfully draw
I've written an entire app pretty successfully in Django but I have this nagging
I have written the following code for inserting video bytes into the database DBAdapter.java
I have written a pretty simple code to get the first result for any
I have successfully constructed something similar to the following code in visual studio 2008:
I have written a C++ library that saves my data (a collection of custom

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.