473,405 Members | 2,338 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

Reading Data from a File into multiple Arrays - Very Urgent

Hi

I am new to this so I dont exactly know the format in which to post the questions ....anyways here goes ...my file looks like this

Year,Day,MOnth,latitude,longitude (commas included)
1973,30,06,36.65,144.70
1973,31,07,35.50,145.08
------
----

and so on ...what I need to know is how I can store it into multiple arrays of

date[],day[],month[],lat[],lon[]


AND GUESS WHAT ...THERE IS A CATCH ....THERE MAY BE LINES WHICH DATA MIGHT NOT BE PRESENT ...I HAVE TO IGNORE THE LINES

I need the code in C. Kindly show me how to use Structures to declare array[]variables in which to store the data.

I have 3 days ...RESCUE ME !
Oct 12 '06 #1
1 2257
Hi

I am new to this so I dont exactly know the format in which to post the questions ....anyways here goes ...my file looks like this

Year,Day,MOnth,latitude,longitude (commas included)
1973,30,06,36.65,144.70
1973,31,07,35.50,145.08
------
----

and so on ...what I need to know is how I can store it into multiple arrays of using FSCANF(very important)

date[],day[],month[],lat[],lon[]


AND GUESS WHAT ...THERE IS A CATCH ....THERE MAY BE LINES WHICH DATA MIGHT NOT BE PRESENT ...I HAVE TO IGNORE THE LINES

I need the code in C. Kindly show me how to use Structures to declare array[]variables in which to store the data.

I have 3 days ...RESCUE ME !
Oct 12 '06 #2

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

Similar topics

3
by: sridevi | last post by:
Hello How to export data from ms-access database to excel worksheet using ASP. mainly i need to export data to multiple worksheets. it is very urgent to us. i have a sample code which works...
1
by: davis | last post by:
Hello, I am working in .Net C# and have an xml file similar to the one below. I have tried using a DataSet but get the error "The same table (Gid) cannot be the child table in two nested...
7
by: John Pote | last post by:
Hello, help/advice appreciated. Background: I am writing some web scripts in python to receive small amounts of data from remote sensors and store the data in a file. 50 to 100 bytes every 5 or...
1
by: Suresh | last post by:
Hi All, I am using DB2 UDB 8.1 on linux platform. I want to import or read .asc file from DB2 stored procedure. This file contains encryption and decryption key in multiple lines. I have...
0
by: Suresh | last post by:
Hi All, I am using DB2 UDB 8.1 on linux platform. I want to import or read .asc file from DB2 stored procedure. This file contains encryption and decryption key in multiple lines. I have...
6
by: arne.muller | last post by:
Hello, I've come across some problems reading strucutres from binary files. Basically I've some strutures typedef struct { int i; double x; int n; double *mz;
10
by: Tyler | last post by:
Hello All: After trying to find an open source alternative to Matlab (or IDL), I am currently getting acquainted with Python and, in particular SciPy, NumPy, and Matplotlib. While I await the...
7
by: ianenis.tiryaki | last post by:
well i got this assignment which i dont even have a clue what i am supposed to do. it is about reading me data from the file and load them into a parallel array here is the question: Step (1) ...
21
by: Stephen.Schoenberger | last post by:
Hello, My C is a bit rusty (.NET programmer normally but need to do this in C) and I need to read in a text file that is setup as a table. The general form of the file is 00000000 USNIST00Z...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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...
0
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...
0
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,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.