Fortran locate symbol in data file

Click For Summary
SUMMARY

The discussion focuses on locating and eliminating the presence of '////' in a data file using Fortran. The user encountered an error when attempting to use the equality operator with an array instead of a scalar. The suggested solution includes utilizing text editors like VI or Wordpad for a simpler search and replace function, which may be more efficient than coding a solution in Fortran.

PREREQUISITES
  • Understanding of Fortran programming language syntax
  • Familiarity with character data types in Fortran
  • Knowledge of array versus scalar data types in programming
  • Basic skills in using text editors for file manipulation
NEXT STEPS
  • Learn about Fortran character arrays and how to manipulate them
  • Research the use of the Fortran 'WHERE' statement for conditional operations
  • Explore advanced text processing techniques in Fortran
  • Investigate alternative text editors and their search functionalities
USEFUL FOR

This discussion is beneficial for Fortran developers, programmers dealing with data file manipulation, and anyone seeking efficient methods for text processing in programming environments.

agalya
Messages
9
Reaction score
0
I need to look for the presence of '////' in my data file
i could read it as character
since i need to eliminate them from the file,
I've tried to avoid them using
if(xx .eq. '////') then
but is not working the error comes as
if(mt.ne. '////')then
Equality operator at (1) must operate on two scalar (not array) subexpressions, two function invocations returning arithmetic or character scalars, or a combination of both --
but the subexpression at (2)(it '////') is an array

how to achieve what I am thinking?
Can somebody help me in this regard
thanks in advance
 
Last edited:
Technology news on Phys.org
Have you tried just using the VI editor...or even Wordpad (Search and Replace)?
 

Similar threads

  • · Replies 8 ·
Replies
8
Views
2K
  • · Replies 12 ·
Replies
12
Views
3K
  • · Replies 16 ·
Replies
16
Views
3K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
Replies
7
Views
3K
  • · Replies 20 ·
Replies
20
Views
9K
  • · Replies 16 ·
Replies
16
Views
2K
  • · Replies 12 ·
Replies
12
Views
16K
  • · Replies 3 ·
Replies
3
Views
3K