Sponsored Content
Top Forums Shell Programming and Scripting How to swap order of pairs of lines? Post 302488241 by kurumi on Sunday 16th of January 2011 08:33:41 AM
Old 01-16-2011
it does not matter since we are iterating the file anyway.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

reading lines in pairs from file in ksh

I need to read pairs of lines from a file and compare them. We can assume that the number of lines in the file is even. Can i do it in korn shell? (4 Replies)
Discussion started by: ytokar
4 Replies

2. Shell Programming and Scripting

How to grep lines in the particular order?

Hi guys, I am stuck on a simple issue but couldn't find a simple solution. If you have any ideas please help. I have two files : - FILE1 Tue 09/12 Lindsey Wed 09/13 Randy Thu 09/14 Susan Fri 09/15 Randy Sat 09/16 Lindsey Sun ... (2 Replies)
Discussion started by: sam_2921
2 Replies

3. Shell Programming and Scripting

Order file by lines

My script(3 arguments $1 = folder,$2 extension,$3 string) should do the following things: -Enter in the folder of $1(if exists). -Put ls *.$2 > temp.txt ( I use a temp file to store the result of ls command and if $2 = txt in this file I'll have all the .txt files of the folder) -Now I want to... (2 Replies)
Discussion started by: Max89
2 Replies

4. Shell Programming and Scripting

concatenate lines in pairs

Hi, I have a text file with the following contents /C=IT/O=INFN/OU=Personal Certificate/L=Napoli/CN=Some guy /C=IT/O=INFN/CN=INFN CA /O=Grid/O=NorduGrid/OU=uninett.no/CN=Another guy /O=Grid/O=NorduGrid/CN=NorduGrid Certification Authority /C=TW/O=AP/OU=GRID/CN=Someone else... (5 Replies)
Discussion started by: kerl
5 Replies

5. UNIX for Advanced & Expert Users

Swap lines using sed

Hi, I have to swap two consecutive line using sed in a file. My text to swap is available in the file x.pl #Create & map a common work library if (!(-e "../work")) { system ("vlib work ../work"); system ("vmap work ../work"); } system ("vsimsa -do thiagu_dec.do"); In this i... (6 Replies)
Discussion started by: adharmalingam
6 Replies

6. Shell Programming and Scripting

BASH: Swap first two lines in sets of 4

Hi. I may have mentioned in the OP to this thread that the AHK macro script I was trying to sort was, relative to its full length, only partly in the right format to be sorted by the methods discussed in that thread. Now I'm looking to tackle the rest of the data in that AHK script. ... (2 Replies)
Discussion started by: SilversleevesX
2 Replies

7. Shell Programming and Scripting

sed swap lines

Hi, I think it is possible with sed, but I'm not sure... I've a file that contains some text and filenames: gtk-media-pause | CB60471-05 - Gilbert, Brantley - Country Must Be Country Wide.zip | 8175 | /home/floris/Muziek/Karaoke/1341838939/CB60471-05 - Gilbert, Brantley - Country Must Be... (2 Replies)
Discussion started by: jkfloris
2 Replies

8. UNIX for Advanced & Expert Users

Parse (delimited string) key-value pairs in a column into separate lines

Hi experts, e.g. i/p data looks like 0000xm7zcNDIkP888vRqGv93xA7:176n00qql||9700005405552747,9700005405717924,9700005405733788|unidentified,unidentified,unidentified|| o/p data should like - row1: 0000xm7zcNDIkP888vRqGv93xA7:176n00qql||9700005405552747|unidentified ... (1 Reply)
Discussion started by: sumoka
1 Replies

9. Shell Programming and Scripting

File w/ many line pairs--how do I order based on 1st lines only?

I have a file in which the data is stored in pairs of lines. The first line (beginining with ">") is a header, the second line is a sequence. I would like to sort the file by species name. Desired output for the example file: I can use sort -t'_' -k2 to alphabetize headers in the... (1 Reply)
Discussion started by: pathunkathunk
1 Replies

10. Shell Programming and Scripting

Remove lines with duplicate pairs where AB is equal to BA

I have a file with four columns like dmn10003t1 PF00001 PF00022 dmn12390t1 dmn10008t1 PF00069 PF00027 dmn9781t1 dmn10008t1 PF00068 PF00027 dmn9781t1 dmn10008t1 PF00069 PF00069 dmn9781t1 dmn12390t1 PF00069 PF00076 dmn10003t1 I want to create a new file by comparing the repeated word pairs... (2 Replies)
Discussion started by: sammy777
2 Replies
X_SOLVE_DC_DRIFT(1gmt)					       Generic Mapping Tools					    X_SOLVE_DC_DRIFT(1gmt)

NAME
x_solve_dc_drift - Find Best-fitting D.C.-shift and Drift Estimates SYNOPSIS
x_solve_dc_drift [ -Xxbase ] [ -Llbase ] [ -Iignorefile ] [ -S ] [ -Citeration ] [ -Mmin_nx ] [ -Rwest/east/south/north ] [ -Uuselegsfile ] [ -V ] [ -Bbinfile ] [ -AASCIIfile ] DESCRIPTION
x_solve_dc_drift will read the database files and, by iterating, find the best-fitting regression line to the <time,COE> points for each leg that minimizes the overall standard deviation of the data set in a least squares sense. Finally, correction file(s) are created. -X Indicate an alternate database to read. [Default is xx_base.b]. -L Indicate an alternate legbase to read. [Default is xx_legs.b]. -I Ignore information for certain legs (that might be bad, etc). -S Reset the old d.c.-shift and drift estimates to zero before iterating. -C Specify how many iterations to do. Default is interactive session. -M Solve for drift only if the leg has more than min_nx cross-overs. -R Only take COEs inside this region into account. [Default is world]. -U Solve for corrections involving COEs from legs in the uselegsfile only. -B Create a binary correction file (which can be read by x_list and gmtlist). -A Create an ASCII correction table. At least one of -A and -B must be specified. -V Selects verbose mode, which will send progress reports to stderr [Default runs "silently"]. BEWARE
The reason for the -M option is that if the COEs are few, then a stable estimate of the slope may not be obtained (e.g. when most of the COEs occur midway between ports). However, in most cases the bulk of the COEs do occur near the ports so that a drift estimate can be com- puted. Conventional wisdom recommends plotting the time-series and the computed regression line to see if it makes sense. SEE ALSO
GMT(1), x_system(1) REFERENCES
Wessel, P. XOVER: A Cross-over Error Detector for Track Data, Computers & Geosciences, 15, 333-346. GMT 4.5.7 15 Jul 2011 X_SOLVE_DC_DRIFT(1gmt)
All times are GMT -4. The time now is 09:46 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy