Sponsored Content
Top Forums Shell Programming and Scripting How to manipulate first column and reverse the line order in third and fourth column? Post 302338942 by Max Well on Thursday 30th of July 2009 04:13:15 AM
Old 07-30-2009
How to manipulate first column and reverse the line order in third and fourth column?

How to manipulate first column and reverse the line order in third and fourth column as follws?

For example i have a original file like this:

file1
Code:
     0.00000000E+000    -1.17555359E-001     0.00000000E+000
     2.00000000E-002    -1.17555359E-001     0.00000000E+000
     4.00000000E-002    -1.17639683E-001     0.00000000E+000
     6.00000000E-002    -1.17655106E-001     0.00000000E+000
     8.00000000E-002    -1.17603991E-001     0.00000000E+000
     1.00000000E-001    -1.17488978E-001     0.00000000E+000

I want to
-manipulate first column
-reverse the line order in third and fourth column (I can already do that:
https://www.unix.com/shell-programming-scripting/35832-reversing-order-lines-file-4.html
)
-remove last line.

-->file2:
Code:
     1.20000000E-001    -1.17603991E-001     0.00000000E+000
     1.40000000E-001    -1.17655106E-001     0.00000000E+000
     1.60000000E-001    -1.17639683E-001     0.00000000E+000
     1.80000000E-001    -1.17555359E-001     0.00000000E+000
     2.00000000E-001    -1.17555359E-001     0.00000000E+000

Finally I 'm going to merge these files.

---------- Post updated 30-07-09 at 11:13 AM ---------- Previous update was 29-07-09 at 05:08 PM ----------

What I wanted most was to know this:
Quote:
Originally Posted by Max Well
I want to
-manipulate first column
Other questions are extra.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

read line in reverse order from file

dear all i want to read 5th no of line from last line of file. kindly suggest me possible ways. rgds jaydeep (2 Replies)
Discussion started by: jaydeep_sadaria
2 Replies

2. Shell Programming and Scripting

Conditional reverse of certain file line order

Hi I am brand new to programming, I dont know how to go about this task, or what language is best for this...If there is an easy solution in different languages, I would love to see them. I want to learn about the steps to take on this, so Please put in comments where code is used. I believe in... (9 Replies)
Discussion started by: perlrookie
9 Replies

3. Shell Programming and Scripting

Use awk to have the fourth column with spaces

Hi Gurus, We have a ftpserver from which we do a dir command and output it to a local file. The content of the ftpfile is: 07-15-09 06:06AM 5466 ABC_123_ER19057320090714082723.ZIP 07-15-09 06:07AM 3801 ABC_123_ER19155920090714082842.ZIP 07-15-09 06:07AM ... (14 Replies)
Discussion started by: donisback
14 Replies

4. Shell Programming and Scripting

Print rows in reverse order if values decrease along the column

Hi, Guys. Please help me to find solution to this problem using shell scripting. I have an INPUT file with 4 columns separated by tab. Each block of records is separated by ----- ----- Sample1 5402 6680 Pattern01 Sample2 2216 2368 Pattern02... (6 Replies)
Discussion started by: sam_2921
6 Replies

5. Shell Programming and Scripting

comparing column of two different files and print the column from in order of 2nd file

Hi friends, My file is like: Second file is : I need to print the rows present in file one, but in order present in second file....I used while read gh;do awk ' $1=="' $gh'" {print >> FILENAME"output"} ' cat listoffirstfile done < secondfile but the output I am... (14 Replies)
Discussion started by: CAch
14 Replies

6. Shell Programming and Scripting

1st column,2nd column on first line 3rd,4th on second line ect...

I need to take one column of data and put it into the following format: 1st line,2nd line 3rd line,4th line 5th line,6th line ... Thanks! (6 Replies)
Discussion started by: batcho
6 Replies

7. Shell Programming and Scripting

replace by match on fourth column

Hi friends, My input file is this way chr1 100 200 "abc" chr1 350 400 "abc" chr2 450 600 "def" chr2 612 780 "def" How do I make this file into chr1 100 400 "abc" chr2 450 780 "def" This is basically matching on the fourth column and taking the minimum of second column and the... (4 Replies)
Discussion started by: jacobs.smith
4 Replies

8. Shell Programming and Scripting

Manipulate XML File Continous STRING by each Order Line using SHELL

heres sample File: <?xml version="1.0"?> <!DOCTYPE cXML SYSTEM "www"><cXML.............................................. <OrderRequest>USE UNIX.com</Extrinsic><Extrinsic name="UniqueName">Peter@UNIX.com</Extrinsic><Extrinsic name="ContractingEntity">UNIX... (3 Replies)
Discussion started by: Pete.kriya
3 Replies

9. Shell Programming and Scripting

Remove the first character from the fourth column only if the column has four characters

I have a file as follows ATOM 5181 N AMET K 406 12.440 6.552 25.691 0.50 7.37 N ATOM 5182 CA AMET K 406 13.685 5.798 25.578 0.50 5.87 C ATOM 5183 C AMET K 406 14.045 5.179 26.909 0.50 5.07 C ATOM 5184 O MET K... (14 Replies)
Discussion started by: hasanabdulla
14 Replies

10. Shell Programming and Scripting

[Solved] Extract First character in fourth column

Hi Experts, I am new to UNIX. One of my file records are like below 220 IN C/A 515013 NULL NULL 220 IN C/A 515017 NULL NULL 225 IN C/A 333701 NULL NULL 225 IN C/A 515034 NULL NULL 225 IN C/A 499201 NULL NULL 225 IN C/A 499202 NULL NULL The above mentioned records delimiter is... (4 Replies)
Discussion started by: suresh_target
4 Replies
cryptest(1)						      General Commands Manual						       cryptest(1)

NAME
cryptest - Test Driver for Crypto++, a C++ Class Library of Cryptographic Primitives SYNOPSIS
cryptest [OPTION] DESCRIPTION
cryptest takes the following options g generate an RSA key h display usage information r encrypt and decrypt a string using RSA rs privatekeyfile messagefile signaturefile sign a file using RSA rv publickeyfile messagefile signaturefile verify a signature of a file using RSA m file calculate MD5, SHA, and RIPEMD-160 message digests t encrypt and decrypt a string using DES-EDE in CBC mode e|d input output encrypt or decrypt a file ss <threshold> <number-of-shares> file secret share a file (shares will be named file.000, file.001, etc) sr file share1 share2 [....] reconstruct a secret-shared file (number of shares given must be equal to threshold) id <threshold> <number-of-shares> file information disperse a file (shares will be named file.000, file.001, etc) ir file share1 share2 [....] reconstruct an information-dispersed file (number of shares given must be equal to threshold) z <compression-level> input output gzip a file u input output gunzip a file ae input output encrypt a file with AES in CTR mode e64 input output base64 encode a file d64 input output base64 decode a file e16 input output hex encode a file d16 input output hex decode a file ft source-port destination-host destination-port forward a TCP connection fips run the FIPS 140-2 sample application fips-rand generate 100000 random files using FIPS Approved X.917 RNG mt input run Maurer's randomness test on a file v run validation tests V display version number b [time for each benchmark in seconds] [frequency of CPU in gigahertz] run benchmarks tv filename run test vector file (available in TestVectors example subdirectory) AUTHOR
This man page was created by Stephen Zander, Pierre Machard and Jens Peter Secher for the Debian distribution. It is licenced under the same terms as the rest of the Crypto++ library, written by Wei Dai. local cryptest(1)
All times are GMT -4. The time now is 04:02 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy