1. Not finding help here? Sign up for a free 30min tutor trial with Chegg Tutors
    Dismiss Notice
Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

C\C++ help needed

  1. Oct 30, 2009 #1
    C\C++ help needed URGENT!!!

    I need help in C program
    I have to write a c/C++ progam to read a particular column in a .txt file.
    like
    23.40 90.46 -129.8 -0.3
    22.51 90.91 11.7 7.6
    22.51 91.35 11.3 -0.0
    22.06 90.46 29.1 7.8
    22.06 90.91 -12.6 3.8
    22.06 91.35 -49.2 -29.2
    22.06 91.80 -28.7 30.6
    In the abv file i have to read the third column and write in the seperate .txt file.
     
  2. jcsd
  3. Oct 30, 2009 #2
    Re: C\C++ help needed URGENT!!!

    One simple approach:
    1) Open the file and read each line to a string
    2) Use space delimiter to make an temporary array
    3) Make new file and write the third value
    ...
     
  4. Oct 30, 2009 #3

    Hepth

    User Avatar
    Gold Member

    Re: C\C++ help needed URGENT!!!

    its even easier if you know the number of columns. fscanf() works great for regular tabulated data.
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook




Similar Discussions: C\C++ help needed
  1. Need help using C+ (Replies: 2)

  2. C help needed. (Replies: 1)

  3. C program help needed (Replies: 3)

Loading...