473,549 Members | 3,048 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Code for Reading text file with n number of rows and columns.

2 New Member
Respected Sir/madam,

Can you help in providing code in 'C' for Reading text file with n number of rows and columns and putting the result in arrays.The sample file is as follows:


rim_label = 'aeff5'
state 0 = 'eee'
state 1 = 'ffffff'
.
.and so on...

There are equal no of rows and columns and '=' sign can be eliminated while storing these two columns in array.There should two arrays in storing these two columns in a text file.

Yours trully,
Jasvinder singh
Dec 5 '07 #1
3 3159
sicarie
4,677 Recognized Expert Moderator Specialist
And what have you done so far on this?
Dec 5 '07 #2
jasvinder singh
2 New Member
And what have you done so far on this?
Actually i am new to file handling in 'C 'and i don't know how this logic implements in C code..so kindly start up by providing some guidance on it..According to which i will start working on it.

Regards,
jasvinder singh.
Dec 5 '07 #3
sicarie
4,677 Recognized Expert Moderator Specialist
Google search 'c file handling tutorial'
Dec 5 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

2
5123
by: Anita C | last post by:
Hi, How do I associate or map a specific column in a datatable to a particular element present in an xml document - to read into a datatable as well as write from the datatable to the xml element? Also, how can I associate all the attributes and their values of a particular element to the Name & Value columns of a datatable - to read into a...
2
1706
by: jason | last post by:
Hello everyone, Just curious what would cause an .aspx page to not execute its inline code. <%# DataBinder.Eval... %> stuff is working just fine, but anything else contained by the <% %> tags in the .aspx page just gets sent literally to the client, including the <% %> tags themselves. I read something about this being related to...
11
2974
by: Michael McGarry | last post by:
Hi, I am reading strings from a text file using fscanf("%s", currToken); This returns strings delimited by whitespace. How can I tell if the string was followed by a carriage return in the file? Michael
68
6769
by: Martin Joergensen | last post by:
Hi, I have some files which has the following content: 0 0 0 0 0 0 0 1 1 1 1 0 0 1 1 1 1 0 0 1 1 1 1 0 0 1 1 1 1 0 0 0 0 0 0 0
4
12776
by: Amit Maheshwari | last post by:
I need to read text file having data either comma seperated or tab seperated or any custom seperator and convert into a DataSet in C# . I tried Microsoft Text Driver and Microsoft.Jet.OLEDB.4.0 to read text file but could not get the data in correct format. All columns are not coming in dataset and rows are messing up. Suggestions...
1
14869
by: becca0619 | last post by:
Hey, Ive been looking around to find out how to read data into a 2D array and I cant find a solution that will fit my assignment. Im not sure that I should even use an array actually... ok so there is a text file set up like this 21909 87 98 95 96 79 21910 74 75 84 86 57 21911 84 85 82 80 79 etc... There is no defined number of items in...
2
1466
by: Rob111b | last post by:
Hi there, I need to make a piece of code in C that 1. opens a specified file, 2. Reads the data in the file and separates it as shown below, 3. Converts the strings into integers and then perfoms some manipulation on them, 4. returns the new values to a second text file (possibly, not quite sure on this one yet).
9
1497
by: flavourofbru | last post by:
HI, I am reading a text file and then adding 1 to each element and displaying it. the code is as follows: #include "stdafx.h" #include <iostream> #include <fstream> #include <string>
4
3745
by: C++ Newbie | last post by:
Suppose I have a text file with the input: 1 2 3 4 5 6 7 8 9 10 ! Comment: Integers 1 - 10 How do I write a C++ program that reads in this line into a 10-element vector and ignores the comment? Thanks.
0
7520
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7446
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7956
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7470
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7809
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6041
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
5088
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3480
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1936
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.