Sponsored Content
Top Forums UNIX for Beginners Questions & Answers Need to print nth till last column of ls output using sed Post 303038232 by rdrtx1 on Wednesday 28th of August 2019 09:45:30 AM
Old 08-28-2019
no braces examples:
Code:
ls -ltr /app/deploy.yml | awk '$2=$4=$5=_;1'
ls -ltr /app/deploy.yml | sed 's/\([^ ]*\) *[^ ]* \([^ ]*\) *[^ ]* *[^ ]* */\1 \2 /'


Last edited by rdrtx1; 02-18-2020 at 07:52 PM..
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to print lines till till a pattern is matched in loop

Dear All I have a file like this 112534554 446538656 444695656 225696966 226569744 228787874 113536566 443533535 222564552 115464656 225445345 225533234 I want to cut the file into different parts where the first two columns are '11' . The first two columns will be either... (3 Replies)
Discussion started by: anoopvraj
3 Replies

2. Shell Programming and Scripting

Want to zip the all files till nth depth

All, i need a script which can zip the all files which are in directories and its subdirectories for example: dir1 contains file1,file2,dir1a,dir1b now dir1a also contains fil11,fil12 ,dirab so script should look for files in dir or sub dir till files not found and... (2 Replies)
Discussion started by: vijays3
2 Replies

3. Shell Programming and Scripting

extract nth line of all files and print in output file on separate lines.

Hello UNIX experts, I have 124 text files in a directory. I want to extract the 45678th line of all the files sequentialy by file names. The extracted lines should be printed in the output file on seperate lines. e.g. The input Files are one.txt, two.txt, three.txt, four.txt The cat of four... (1 Reply)
Discussion started by: yogeshkumkar
1 Replies

4. Shell Programming and Scripting

Using tr, sed or awk to delete text from nth column only

Hi everyone, this is my first post here, I hope someone can help me. I have a file which I need to delete characters '_F3' from the end of the text in the first column. The problem is that the characters may also occur elsewhere in the file (i.e. second columns onwards). I tried sed (thinking I... (6 Replies)
Discussion started by: hlwright
6 Replies

5. Shell Programming and Scripting

Print a column with the name of the output file

I have n files and I am using cat to combine them in to one. Before that simply add the name of the output file to 4th column and then print the output. Is it possible ? input1 chr start end name 0 + key input2 chr start end name 0 + key inputn... (1 Reply)
Discussion started by: quincyjones
1 Replies

6. Shell Programming and Scripting

Using AWK to find top Nth values in Nth column

I have an awk script to find the maximum value of the 2nd column of a 2 column datafile, but I need to find the top 5 maximum values of the 2nd column. Here is the script that works for the maximum value. awk 'BEGIN { subjectmax=$1 ; max=0} $2 >= max {subjectmax=$1 ; max=$2} END {print... (3 Replies)
Discussion started by: ncwxpanther
3 Replies

7. Shell Programming and Scripting

Calculating average for every Nth line in the Nth column

Is there an awk script that can easily perform the following operation? I have a data file that is in the format of 1944-12,5.6 1945-01,9.8 1945-02,6.7 1945-03,9.3 1945-04,5.9 1945-05,0.7 1945-06,0.0 1945-07,0.0 1945-08,0.0 1945-09,0.0 1945-10,0.2 1945-11,10.5 1945-12,22.3... (3 Replies)
Discussion started by: ncwxpanther
3 Replies

8. Shell Programming and Scripting

Transpose from 2nd column till the last column

Hi I have 5 columns like this a b c d e f g h i j k l m n o From 2nd column till the 5th column of every record, I would like to transpose them as rows, so my output file contains only one row a b c d e f g h i j (9 Replies)
Discussion started by: jacobs.smith
9 Replies

9. Shell Programming and Scripting

[Solved] Find and replace till nth occurence of a special character

Hi, I have a requirement to search for a pattern in each line in a file and remove the in between words till the 3rd occurrence of double quote ("). Ex: CREATE TABLE "SCHEMANAME"."AMS_LTV_STATUS" (Note: "SCHEMANAME" may changes for different schemas. Its not a fixed value) I need to... (2 Replies)
Discussion started by: satyaatcgi
2 Replies

10. Shell Programming and Scripting

awk Print New Column For Every Two Lines and Match On Multiple Column Values to print another column

Hi, My input files is like this axis1 0 1 10 axis2 0 1 5 axis1 1 2 -4 axis2 2 3 -3 axis1 3 4 5 axis2 3 4 -1 axis1 4 5 -6 axis2 4 5 1 Now, these are my following tasks 1. Print a first column for every two rows that has the same value followed by a string. 2. Match on the... (3 Replies)
Discussion started by: jacobs.smith
3 Replies
Tangram::Relational(3pm)				User Contributed Perl Documentation				  Tangram::Relational(3pm)

NAME
Tangram::Relational - Orthogonal Object Persistence in Relational Databases SYNOPSIS
use Tangram; $schema = Tangram::Relational->schema( $hashref ); Tangram::Relational->deploy($schema, $dbh); $storage = Tangram::Relational->connect( $schema, $data_source, $username, $password ); $storage->disconnect(); Tangram::Relational->retreat($schema, $dbh); DESCRIPTION
This is the entry point in the vanilla object-relational persistence backend. Vendor-specific backends should be used when they exist. Cur- rently Mysql, Sybase and Oracle have such backends; see Tangram::mysql, Tangram::Sybase and Tangram::Oracle. More backends could be added in the future; they might implement persistence in XML documents, pure object databases, using C database libraries to bypass the need for an RDBMS, etc. CLASS METHODS
schema $schema = Tangram::Relational->schema( $hashref ); Returns a new Schema object. See Tangram::Schema. deploy Tangram::Relational->deploy($schema); Tangram::Relational->deploy($schema, HANDLE); Tangram::Relational->deploy($schema, @dbi_args); Writes SQL statements for preparing a database for use with the given $schema. Called with a single argument, writes SQL statements to STDOUT. Called with two arguments, writes SQL statements to HANDLE. HANDLE may be a DBI connection handle or a file handle. Called with more than two arguments, passes all but the first to DBI::connect() and writes statements to the resulting DBI handle, which is automatically closed. The SQL code is only guaranteed to work on newly created databases. connect $storage = Tangram::Relational->connect( $schema, $data_source, $user, $password, \%options ) Connects to a storage and return a handle object. Dies in case of failure. $schema is a Schema object describing the system of classes stored in the database. $data_source, $user and $password are passed directly to DBI::connect(). \%options is a reference to a hash containing connection options. See Tangram::Storage for a description of available options. retreat Tangram::Relational->retreat($schema); Tangram::Relational->retreat($schema, HANDLE); Tangram::Relational->retreat($schema, @dbi_args); Remove the tables created by deploy(). Only guaranteed to work against a database that was deployed using exactly the same schema. For an explanation of the possible argument lists, see deploy. WRITING A VENDOR DRIVER
Like Charles Moore (inventor of Forth) used to say, "standards are great, everybody should have one!". Tangram can take advantage of extensions available in some SQL dialects. To create a vendor-specific driver, call it "Tangram::Foo" (where "Foo" is the name of the DBI driver, as would be selected with the DBI connection string "dbi:Foo:"), and derive "Tangram::Relational". For now, the existing back-ends should be used as examples of how to extend Tangram to support different databases or utilise some of their more exotic features. perl v5.8.8 2006-03-29 Tangram::Relational(3pm)
All times are GMT -4. The time now is 11:30 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy