Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  • Users: hill007
  • Order by date
  1. hill007

    Replacing numbers in afile with a text search

    Thanks for your response. However, I do not have access to SED. I only use AWK. Is there anyway that the above program me modified for AWK? Thanks.
  2. hill007

    Replacing numbers in afile with a text search

    I have a large data set and I need to replace the content of the data set by a number based on a text search. However, I want to keep the same format as it was in the original file. Here is a small example of the file: 15 1.000(10e12.4) -1 CONSTANT 0.0000e+00...
  3. hill007

    Change data values based on string query

    I did, however, there is only one space between them , not two spaces. What I mean is: 1.4500e+04 1.4500e+04 1.4500e+04 It should be: 1.4500e+04 1.4500e+04 1.4500e+04 There should be two spaces between them.
  4. hill007

    Change data values based on string query

    Hi Feherke, It works excellent! I already tested in my 1 GB dataset. However, I have some formatting issue question. Is it possible for you to manupulate the code little bit so that the data is in fortran format as in the data set, i.e. it should look like this: 11 1.000(10e12.4)...
  5. hill007

    Change data values based on string query

    Hi Feherke, I am trying using awk95. I will try again and let you know. Thanks.
  6. hill007

    Change data values based on string query

    Hi feherke, The code do not work on the large data set. I am attaching a small part of the dataset. If you make a search "Hydraulic Conductivity Layer 1", the data sets below that layer needs to be changed untill it reaches "Bottom Layer 1". I have total of 20 such sets in one large file...
  7. hill007

    Change data values based on string query

    I have a large file with different information, but in a structured fashion. I just want to change the values of one structured information. A small example will help as what exactly I am talking about: Example set: 0 0 -99 1 22465 1 2 5 6 7 11 1.000...
  8. hill007

    Subtracting values from a matrix

    I am trying to subtract a value of 25 from the cells of a matrix. Example: 2 3 6 9 12 -3 4 7 -2 -6 3 10 4 8 14 After subtracting 25 from the cells of the above matrix, it should be: -23 -22 -19 -16 -13 -28 -21 -18 -27 -31 -22 -15 -21 -17 -11 How would I do this in awk95. Any help...
  9. hill007

    Difference between two matrix

    I am sending this email, which I had sent earlier but with slight different approach. I have two large matrix, with same dimensions. I want to compare matrix 1 file with matrix 2 file. I just now want to subtract the cells of matrix 1 from matrix 2. Example Matrix 1 2 3 6 9 12 -3 4 7 -2...
  10. hill007

    Comparing two matrix files and subtracting values from the second matr

    Hi PHV, I am looking for an AWK program. I have only awk95, no NAWK. Thanks.
  11. hill007

    Comparing two matrix files and subtracting values from the second matr

    I have two large matrix, with same dimensions. I want to compare matrix 1 file with matrix 2 file. The cells where matrix 2 file is greater than matrix 1 file, change those cells in matrix 2 by subtracting by -5. Example Matrix 1 2 3 6 9 12 -3 4 7 -2 -6 3 10 4 8 14 Matrix 2 3...
  12. hill007

    Adding comma to each field data

    I am trying to add comma to data in two columns. I have tried to bring into excel, however, the data size is large. My data is in this format: 1678.3 2.567 3.1267 4562.1 367.4 7.98 etc I want the data to be in this format: 1678.3,2.567,3.1267 4562.1,367.4,7.98 Thanks.
  13. hill007

    Average of a matrix

    Hi friends, I need a help to determine an average of a large matrix, which has 328 rows and 368 columns. I am including an example as what I achieve to do: Example matrix (3 by 4): 3 4 8 9 1 6 9 6 2 3 4 8 The average of first column (3, 1, and 2)is: 2 The average of second column (4,6,3)...
  14. hill007

    Breaking a large file into multiple file based on first two columns

    I want to break a large file into multiple file based on first two columns: For example my file is as follows: 87.73,49.62,-45.000000,0,-261581.000000,0.000000,1,1 87.73,49.62,-45.000000,0,-261581.000000,0.000000,2,2 87.73,49.62,-45.000000,0,-261581.000000,0.000000,3,3...
  15. hill007

    Breaking a large file after each interval into multiple files

    I have a large dataset, where I want to break the file into smaller files after certain number of rows. Example, my dataset looks like: G-1222 1 OBSERVED 0.0000 0.0000 583 COMPUTED 1 3 7 9 15 12 G-1736 1 OBSERVED 0.0012 0.000 583 COMPUTED 5 7 3 6 6 8 The final output will be in the form...
  16. hill007

    To read the last 500 lines

    Hi futurelet, Thanks for the code. It works fine. If I want to use the same code to extract first 500 lines, instead of TAIL what command should I replace with? Thanks.
  17. hill007

    To read the last 500 lines

    Hi PHV, Running the command generates the same file size.
  18. hill007

    To read the last 500 lines

    I have a large dataset and I cannot open the file, so I just want to read the last 500 lines of the dataset. I am sure there is a simple command in awk that will do so. Could any one please help me in this regard. Thanks.
  19. hill007

    Deleting a line and moving the contents of the line below one step up

    Hi PHV, Sorry. It was my fault. The code works perfectly. Thanks again.
  20. hill007

    Deleting a line and moving the contents of the line below one step up

    Hi PHV, I have written my input file as TEST.DAT Here is the input file: 1 2 3 A B 5 6 1 2 3 0 0 CONTENTS 1 0 2 1 2 3 4 5 1 3 T B 6 0 0 CONTENTS 1 0 2 P Q W 4 7 0 0 CONTENTS 1 0 2 I have written your code in a TEST.AWK file: { !/^CONTENTS/ } I then ran awk95 from the directory which...

Part and Inventory Search

Back
Top