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 SkipVought 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: *

  1. mguha06

    Formatting columns in ceratin format -- Need help

    Can anyone help me out with formatting a large dataset in certain form, i.e. The final form should look like this 31 0.00 0.00 0.94 0.00 0.00 0.00 0.06 0.00 0.00 4.76 1 1968 29 120.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 2 1968 Where the...
  2. mguha06

    Formatting Column to Rows

    I have a large series of text in 3 columns and its needs to be formatted to single row of every 12 rows of the columns; example data set. 1867 1 6.40 1867 2 5.90 1867 3 4.70 1867 4 3.70 1867 5 2.50 1867 6 2.20 1867 7 2.40 1867 8 3.20 1867 9 4.30 1867 10 5.20 1867 11 5.90 1867 12 6.90 1868 1...
  3. mguha06

    Subtract 2 matrix in awk

    I am trying to subtract two matrix which are large file, into one matrix. The matrix for example as follows: Matrix 1 4 5 7 8 6 9 12 5 3 1 0 2 Matrix 2 7 9 2 0 1 3 6 2 3 5 8 1 Subtract result will be: -3 -4 5 8 5 6 6 3 0 -4 -8 1 Any help will eb gratly appreciated. Thanks.
  4. mguha06

    Selecting values diagonally in a matrix file

    I am using gawk now. It works. I think, when the starting row number is greater than the ending row number, it does not output correctly. Anyhow, it is a great code. I am giving you all the stars that i can give.
  5. mguha06

    Selecting values diagonally in a matrix file

    awk95 -v s='1,2' -v e='4,4' -f mg.awk myMatrix.txt I have replaced nawk with awk95 (that's the version I am using). It runs, but with no output data.
  6. mguha06

    Selecting values diagonally in a matrix file

    I am using awk95 and I am getting an error. This is the command I am using awk95 -f -v s='1,2' -v e='4,4' -f mg.awk myMatrix.txt
  7. mguha06

    Selecting values diagonally in a matrix file

    Thanks vgersh99! However, I only use awk not nawk. Can the first part of the statement be written in awk? Thanks.
  8. mguha06

    Selecting values diagonally in a matrix file

    I am trying to figure out, how to extract data points from a large matrix (m by n) file. I want to extract data along an inclined straight line, along any row and column of a matrix. Example below is what I want to achieve: Matrix Example 20 21 22 290 46 7 12 18 13 12 16...
  9. mguha06

    Extracting data from files along some coordinates

    Annihilannic, I am using AWK95, I am still getting error in outputting the data as you suggested. Is there any other way. Thanks.
  10. mguha06

    Extracting data from files along some coordinates

    Dear Friends, I have a question regarding extracting some data from a series of matrix files (large files) along any cooordinate lines. Here is an example as what I meant: 5 8 12 7 9 3 8 6 File1.dat 4 5 7 4 3 6 4 4 5 8 7 3 File2.dat 2 0...
  11. mguha06

    Convert to a matrix format

    Thank you so much Feherke!
  12. mguha06

    Convert to a matrix format

    Hello, Can anyone help me out to write an output in matrix format in AWK95, where my input file is in the form of, example: 2,3,1,0,A,0,1,42 2,4,1,0,B,0,1,42 3,1,1,0,C,0,1,42 3,2,1,0,D,0,1,42 3,3,1,0,E,0,1,42 4,6,1,0,F,0,1,42 4,7,1,0,G,0,1,42 My output file would be in the form: A B C D...
  13. mguha06

    Formatting

    I have a large text file with date and time. I want to get rid of the date and only have the time. Example data: 5/31/2006 10:21:00 5/31/2006 10:21:01 5/31/2006 10:21:02 5/31/2006 10:21:03 5/31/2006 10:21:04 5/31/2006 10:21:05 5/31/2006 10:21:06 My final data set should look like this...
  14. mguha06

    Merging data sets into one large data

    Hi Feherke, Execellent! It works. It works the way I wanted. I always use awk95, I have a free version of awk95.exe. I am giving you a star.
  15. mguha06

    Merging data sets into one large data

    I have a series of datasets called, fi.dat, f2.dat,f3.dat, etc. Example of one of the dataset is given below: f1.dat A B C D E F G H I J K L f2.dat 0.1 0.2. 0.4 A B C D 1 2 3 4 My final dataset should look like: final.dat A B C D E F G H I J K L 0.1 0.2. 0.4 A B C D 1 2 3 4 What's...
  16. mguha06

    Formatting a text file based on row numbers

    Hi Feherke, Congratulations! Its works now. It was my mistake, to mistakenly name the output file name as the input file. I am giving you a star. Thanks for lots of help. Truely appreciate. This site is great! Thanks.
  17. mguha06

    Formatting a text file based on row numbers

    Hi Feherke, As suggested, I again re-ran, hwoever, this time the f1.dat, f2.dat, and f3.dat now turned empty. No adat in it.
  18. mguha06

    Formatting a text file based on row numbers

    Hi Feherke, As you suggested, I tried the process:, the generator.awk program is such: BEGIN { for (i=1;i<=3;i++) print "awk95 -f test.awk f" i ".dat > c:\temp\test\\f" i ".dat" } when I run in the DOS prompt, C:\temp\test> awk95 -f generator.awk > commands.bat it generates the...
  19. mguha06

    Formatting a text file based on row numbers

    Hi feherke, When I try the code, with 3 files, it do not provide any output, it just run BEGIN { for (i=1;i<=3;i++) print "awk95 -f test.awk f" i ".dat > output_dir/f" i ".dat" }
  20. mguha06

    Formatting a text file based on row numbers

    Hi PHV, Congratulations! It works. Your perseverance works. I am giving you few stars. I have many such files, and I want to automate it, what should I do. I have close to 500 such files. My files are written in a sequencing format, such as f1.dat, f2.dat, etc. Thanks.

Part and Inventory Search

Back
Top