- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
saving a file in excel as unicode text (*.txt). Is there an oppurtunity to read just one special column in a special row?
Perhaps someone could post an example code.I am trying for ours with deskriptors ... without success
maybe an example:
1234.00 2134.00 14.000
123.00 123.12 2343.00
how would the code look like for reading in 123.12?
READ(unit, 100)
100 Format (????)
Greeting Stutzbach
Link Copied
3 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Assuming that the input file contains only numbers separated by blanks, and that every line contains the same number of entries,
real :: X,DUM
integer, irow = 2, jcol=2, ncol=3
open(unit,...,ENCODING='utf-8')
..
do i=1, irow-1
read(unit,*) ! rows 1.. (irow-1) skipped
end do
read(unit,*)((DUM,j=1,jcol-1), X) ! special value in row=irow, col=jcol
..
The value in the irow-th row and the jrow-th column will be in the variable X.
Unless you want to process implicit decimal points, etc., list-directed I/O is sufficient to do the job.
real :: X,DUM
integer, irow = 2, jcol=2, ncol=3
open(unit,...,ENCODING='utf-8')
..
do i=1, irow-1
read(unit,*) ! rows 1.. (irow-1) skipped
end do
read(unit,*)((DUM,j=1,jcol-1), X) ! special value in row=irow, col=jcol
..
The value in the irow-th row and the jrow-th column will be in the variable X.
Unless you want to process implicit decimal points, etc., list-directed I/O is sufficient to do the job.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
is there anyway to read a number of data that you don't know how much of them are in a row?
for example in unstructured grid there could be a mixes form of grids where there are triangle and squar elements, you don't know which element has 3 side and which has 4?
for example data are like:
3 4 10
20 11 30 12
8 5 2
19 13 29
21 9 2
......
however numbers in a row may differ but there is a maximum number of digits that can be in a row, for example they won't exceed N which will be determined somewhere else, how do you read this?
for example in unstructured grid there could be a mixes form of grids where there are triangle and squar elements, you don't know which element has 3 side and which has 4?
for example data are like:
3 4 10
20 11 30 12
8 5 2
19 13 29
21 9 2
......
however numbers in a row may differ but there is a maximum number of digits that can be in a row, for example they won't exceed N which will be determined somewhere else, how do you read this?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks, it helped a lot

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page