Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
Announcements
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.
29294 Discussions

Reading Tab delimited input files

jonathan_downes
Beginner
766 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
766 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
766 Views

Many thanks

Regards

Jon

0 Kudos
r_robinson
Beginner
766 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