Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

Reading Tab delimited input files

jonathan_downes
Beginner
689 Views

Hi,

Am trying to read some TAB delimited input files (originally came from Excel) into a simple console based program without much luck. Searching the Forums here and the wider internet has not found anything, so any help as how to read the TAB characters would be greatly appreciated.

Thanks

Jon

0 Kudos
3 Replies
greldak
Beginner
689 Views
just read the file intocharacter variables and parse them, creating a new variable, line, element (whatever is appropriate) whenever you find a TAB character that is CHR(9)
0 Kudos
jonathan_downes
Beginner
689 Views

Many thanks

Regards

Jon

0 Kudos
r_robinson
Beginner
689 Views

I thinka free format read will interpret tabs as spaces, at least for numeric data.

For example:

read(1,*) a, b, c

where the file contains "10.020.030.0" where the separators are tabs, not spaces.

You might want to experiment that this works in your case.

0 Kudos
Reply