Sponsored Content
Top Forums Shell Programming and Scripting How to process select list of files and output to the same file? Post 302772186 by RudiC on Sunday 24th of February 2013 04:16:35 AM
Old 02-24-2013
Are we dealing with moving targets or sloppy wording? In post#1, the output file should be bin_range_list_to_superb_txn, in post#3 it was sth_to_txn.tps, sth being the input file name with its suffix deleted.
Guessing that the file name addendum should be the user name granted to, I'd propose
Code:
$ awk '/grant/ {fn=FILENAME"_"$(NF-1)"_"$NF; gsub(/\.tps|;/,"",fn); print > fn}' *.tps

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

I need a script to find socials in files and output a list of those files

I am trying to find socail security numbers in files in (and under) a specific directory and output a list of the files where they are found... the format would be with no dashes just 9 numeric characters in a row. I have tried this: find /DirToLookIn -exec grep '\{9\}' /dev/null {} \; >>... (1 Reply)
Discussion started by: NewSolarisAdmin
1 Replies

2. Shell Programming and Scripting

select data from oracle table and save the output as csv file

Hi I need to execute a select statement in a solaris environment with oracle database. The select statement returns number of rows of data. I need the data to be inserted into a CSV file with proper format. For that we normally use "You have to select all your columns as one big string,... (2 Replies)
Discussion started by: rdhanek
2 Replies

3. Shell Programming and Scripting

Running a select script through UNIX and sending output to file

Hi, (Oracle, AIX) I have googled this and searched this forum, however I haven't had much luck with an answer and have tried several different things. Basically I have a SQL select statement which generates a whole load of UPDATE statements, I want to run the select statement via... (13 Replies)
Discussion started by: dbchud
13 Replies

4. UNIX Desktop Questions & Answers

Script to select a file from a list

i m trying to write a script that will print all the txt files at /home/ directory and will allow a selection of a file and then print the file name. this is what i wrote so far: echo "please select the file from the list " list=$(ls -f *.txt /home/) array=( ) for machine in $list doat... (1 Reply)
Discussion started by: boaz733
1 Replies

5. UNIX for Dummies Questions & Answers

Select text between current date and output to new txt file

Hi guys, brand new to this thread and very very new to UNIX...so go easy please! Anyway I have a file that looks like this: >>-------------------------------------------------------------------------- Date/Time/Eng. : 2012-06-22 / 00:26 / DS Reported problem : (SD) ... (5 Replies)
Discussion started by: martin0852
5 Replies

6. Shell Programming and Scripting

Select only the lines of a file starting with a field which is matcing a list. awk?

Hello I have a large file1 which has many events like "2014010420" and following lines under each event that start with text . It has this form: 2014010420 num --- --- num .... NTE num num --- num... EFA num num --- num ... LASW num num --- num... (9 Replies)
Discussion started by: phaethon
9 Replies

7. UNIX for Dummies Questions & Answers

Select distinct sequences from fasta file and list

Hi How can I extract sequences from a fasta file with respect a certain criteria? The beginning of my file (containing in total more than 1000 sequences) looks like this: >H8V34IS02I59VP SDACNDLTIALLQIAREVRVCNPTFSFRWHPQVKDEVMRECFDCIRQGLG YPSMRNDPILIANCMNWHGHPLEEARQWVHQACMSPCPSTKHGFQPFRMA... (6 Replies)
Discussion started by: Marion MPI
6 Replies

8. Shell Programming and Scripting

How to list files names and sizes in a directory and output result to the file?

Hi , I'm trying to list the files and output is written to a file. But when I execute the command , the output file is being listed. How to exclude it ? /tmp file1.txt file2.txt ls -ltr |grep -v '-' | awk print {$9, $5} > output.txt cat output.txt file1.txt file2.txt output.txt (8 Replies)
Discussion started by: etldeveloper
8 Replies

9. Shell Programming and Scripting

List files with number to select based on number

Hi experts, I am using KSH and I am need to display file with number in front of file names and user can select it by entering the number. I am trying to use following command to display list with numbers. but I do not know how to capture number and identify what file it is to be used for... (5 Replies)
Discussion started by: mysocks
5 Replies

10. Shell Programming and Scripting

Shell Scripting - Select multiple files from numbered list

I am trying to have the user select two files from a numbered list which will eventually be turned into a variable then combined. This is probably something simple and stupid that I am doing. clear echo "Please Select the Show interface status file" select FILE1 in *; echo "Please Select the... (3 Replies)
Discussion started by: dis0wned
3 Replies
gdaltransform(1)					      General Commands Manual						  gdaltransform(1)

NAME
gdaltransform - gdaltransform transforms coordinates SYNOPSIS
gdaltransform [--help-general] [-i] [-s_srs srs_def] [-t_srs srs_def] [-to "NAME=VALUE"] [-order n] [-tps] [-rpc] [-geoloc] [-gcp pixel line easting northing [elevation]]* [srcfile [dstfile]] DESCRIPTION
The gdaltransform utility reprojects a list of coordinates into any supported projection,including GCP-based transformations. -s_srs srs def: source spatial reference set. The coordinate systems that can be passed are anything supported by the OGRSpatialReference.SetFromUserInput() call, which includes EPSG PCS and GCSes (ie. EPSG:4296), PROJ.4 declarations (as above), or the name of a .prf file containing well known text. -t_srs srs_def: target spatial reference set. The coordinate systems that can be passed are anything supported by the OGRSpatialReference.SetFromUserInput() call, which includes EPSG PCS and GCSes (ie. EPSG:4296), PROJ.4 declarations (as above), or the name of a .prf file containing well known text. -to NAME=VALUE: set a transformer option suitable to pass to GDALCreateGenImgProjTransformer2(). -order n: order of polynomial used for warping (1 to 3). The default is to select a polynomial order based on the number of GCPs. -tps: Force use of thin plate spline transformer based on available GCPs. -rpc: Force use of RPCs. -geoloc: Force use of Geolocation Arrays. -i Inverse transformation: from destination to source. -gcppixel line easting northing [elevation]: Provide a GCP to be used for transformation (generally three or more are required) srcfile: File with source projection definition or GCP's. If not given, source projection is read from the command-line -s_srs or -gcp parameters dstfile: File with destination projection definition. Coordinates are read as pairs (or triples) of numbers per line from standard input, transformed, and written out to standard output in the same way. All transformations offered by gdalwarp are handled, including gcp-based ones. Note that input and output must always be in decimal form. There is currently no support for DMS input or output. If an input image file is provided, input is in pixel/line coordinates on that image. If an output file is provided, output is in pixel/line coordinates on that image. Image RPC Example Simple reprojection from one projected coordinate system to another: gdaltransform -s_srs EPSG:28992 -t_srs EPSG:31370 177502 311865 Produces the following output in meters in the 'Belge 1972 / Belgian Lambert 72' projection: 244510.77404604 166154.532871342 -1046.79270555763 Image RPC Example The following command requests an RPC based transformation using the RPC model associated with the named file. Because the -i (inverse) flag is used, the transformation is from output georeferenced (WGS84) coordinates back to image coordinates. gdaltransform -i -rpc 06OCT20025052-P2AS-005553965230_01_P001.TIF 125.67206 39.85307 50 Produces this output measured in pixels and lines on the image: 3499.49282422381 2910.83892848414 50 AUTHORS
Frank Warmerdam warmerdam@pobox.com, Jan Hartmann j.l.h.hartmann@uva.nl GDAL
Tue Sep 18 2012 gdaltransform(1)
All times are GMT -4. The time now is 05:03 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy