Sponsored Content
Full Discussion: Reverse Arrange File
Top Forums UNIX for Dummies Questions & Answers Reverse Arrange File Post 302121269 by The One on Tuesday 12th of June 2007 11:12:34 PM
Old 06-13-2007
Quote:
Originally Posted by vgersh99
Code:
nawk '{ for(i=2;i<=NF;i++) print $1, $i }' myFile

It worked!!! I removed the "n" on the "nawk". Some users maybe confused.
Code:
awk '{ for(i=2;i<=NF;i++) print $1, $i }' myFile

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Need to read a file in reverse

I have to extract data from a text file which is huge in size >>10GB. ie between two strings. If I do an ordinary sed it takes forever to come out. I was wondering if there was anyway to do the entire process in reverse and on finding the relevant string is there any way to break out of the... (5 Replies)
Discussion started by: scorreg
5 Replies

2. Shell Programming and Scripting

how to arrange 3 file to one using awk...?

I have 3 file, I want to re-arrange so all data easy to read from one file only: file1 : userA 10 20 userB 30 40 userC 50 60 .... file2 : userA var1 1000 userA var2 2000 userB var2 3000 userB var3 4000 userB var4 5000 userC var1 6000 ... file3 : userA var3 7000 userA var4 8000 (9 Replies)
Discussion started by: penyu
9 Replies

3. UNIX for Advanced & Expert Users

How to reverse the contents of a file?

Hi Guys, Am new to this forum .... And also to shell scripting I need a k-shell script to reverse the contents of a file... Please come up with the solutions... With regards, Anand (10 Replies)
Discussion started by: aajan
10 Replies

4. Shell Programming and Scripting

how to reverse file

i am using AIX -ksh how can i reverse any file ,i have already try tac cmd it is not in AIX: please help me out. (3 Replies)
Discussion started by: RahulJoshi
3 Replies

5. Shell Programming and Scripting

how to arrange all lines in a file to a single line

Hi Gurus, I am a starter with shell script. Help me to achieve this. I have a file with lines given below. line1 line2 line3 . . etc How can I arrange the file which should look like line1,line2,line3,..,..,etc Any help on this is appreciated. (9 Replies)
Discussion started by: smv
9 Replies

6. Shell Programming and Scripting

script to arrange file in specific format

Hi All, I am new to forum, I am looking to arrange a file in specific format but unable to get the formula to do it, already googled for the same, but didnt find the answer :(. hope to get help here :o:o:o:o:o I have to files : $ cat Dev_List2 0685 0686 0687 0688 0689 068A 068B 068C... (2 Replies)
Discussion started by: prasan_Aix
2 Replies

7. UNIX for Dummies Questions & Answers

reverse first field from the file

Hi all, I have a file named file1as 07/25 00:10 d327490 07/25 00:55 d378299 07/25 03:58 d378299 07/25 06:14 d642035 07/25 12:44 c997126 and now i want to reverse the first filed ie 07/25 as 25/07 00:10 d327490 25/07 00:55 d378299 25/07 03:58 d378299 25/07 06:14 d642035 25/07... (5 Replies)
Discussion started by: zozoo
5 Replies

8. Shell Programming and Scripting

Shell scripting - need to arrange the columns from multiple file into a single file

Hi friends please help me on below, i have 5 files like below file1 is x 10 y 20 z 15 file2 is x 100 z 245 file3 is y 78 z 23 file4 is x 100 (3 Replies)
Discussion started by: siva kumar
3 Replies

9. Shell Programming and Scripting

Reverse Display of a file

Hi all, Just saw a "sed" format to reverse display the file contents, but am not geting its logic completely. I would appreciate if somebody can explain sed '1!G;h;$!d' < filename All I know in this is that : G will add a new line after every line except first one... (5 Replies)
Discussion started by: dextergenious
5 Replies

10. OS X (Apple)

Arrange file by modified date

Hi, Am performing a find based on filename and result can contain multiple files being found Let's say my find command is find /Archive -f -name 12345.pdf and result of find command is /Archive/Folder A/12345.pdf /Archive/Folder B/12345.pdf please note white space in folder names I... (2 Replies)
Discussion started by: gigagigosu
2 Replies
scat(1) 						      General Commands Manual							   scat(1)

Name
       scat - Find catalog stars in a square or circle on the sky

Synopsis
       scat [options] [-b or -j] ra dec

Description
       scat  is  a  utility for finding all of the Hubble Space Telescope Guide Star Catalog (GSC), U.S. Naval Observatory A2.0 (UA2), B1.0 (UB1),
       SA2.0 (USA2), or UJ (UJC) Catalogs, or locally catalogued objects in a specified region of the sky and listing  their  sky  coordinates	to
       standard  output. If the -w flag is set, they are written to a file objectname.catalogname, where objectname is given by the argument to -o
       on the command line, defaulting to "search", and catalogname is given by the argument to -c on the command line. The  catalog  defaults	to
       the  GSC,  if no -c argument is present. scat resembles rgsc(1) and star(1), which can search from lists of coordinates but cannot sort the
       output.	sgsc, suac, and susac are links to this program.1

Options
       -a     List the single closest catalog source

       -b <RA> <Dec>
	      Output B1950 (FK4) coordinates around this center

       -c <name>
	      Reference catalog (gsc(=HST GSC), ua2(=USNO-A2.0), TMC(=2MASS Point Source Catalog), gsc2(=GSC  II),  ub1(=USNO-B1.0),  local  file,
	      etc.)

       -d
	       Output RA and Dec in degrees instead of hh:mm:ss dd:mm:ss

       -e     Output ecliptic coordinates

       -f     Output search center for other programs

       -g <class>
	      HST Guide Star Catalog object class (0=stars 3=galaxies -1=all)

       -h     Print search and column heading, else do not

       -i     Print catalog object name, not catalog number

       -j <RA> <Dec>
	      Output J2000 (FK5) coordinates around this center

       -k <keyword>
	      Add value of this keyword to end of output lines from a tab table search

       -l     Print search center and closest star on one line

       -m [<bright magnitude>] <faint magnitude>
	      Limiting catalog magnitude(s) (default none, bright -2 if only faint is given)

       -n <num>
	      Number of brightest stars to print

       -o <name>
	      Object name used for output file naming

       -q <year>
	      Equinox of output position in fractional years

       -r <radius>
	      Halfwidth (-radius if negative) of search area in arcseconds (default 10)

       -s d|m|n|p|r
	      Sort by (d)eclination, (m)agnitude, (n)o sort, (p)distance from center, or (r)ight ascension.

       -t     Tab table to standard output or file

       -u <x> <y>
	      Print x y instead of number in front of non-tab output, before RA and Dec or add x and y columns to end of tab output line

       -v     Verbose listing of processing intermediate results

       -w     Write output file objectname.catalog or search.catalog if -o is not used.

       -x <type>
	      GSC object type (0=stars 3=galaxies -1=all -2=bands)

       -y <year>
	      Epoch of output positions in fractional years (for proper motion only)

       -z     Append to existing output file search.catalog or objectname.catalog.  Start file if it does not already exist.

See Also
       imcat()

Web Page
       http://tdc-www.harvard.edu/software/wcstools/scat/

Author
       Doug Mink, SAO (dmink@cfa.harvard.edu)

30 January 2003 						     WCSTools								   scat(1)
All times are GMT -4. The time now is 11:19 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy