Sponsored Content
Full Discussion: Grep into columns
Top Forums UNIX for Dummies Questions & Answers Grep into columns Post 302858447 by Martincorneuk on Monday 30th of September 2013 11:34:20 AM
Old 09-30-2013
Grep into columns

Hi folks,
hopefully an easy one .... I've got a hefty patching project going on on Solaris 8 boxes.....

I'm trying to make a spreadsheet with the current packages, revision , description, patches etc

I'd like to put the information output from pkginfo into columns... so eg :-
system SUNWab2r Answerbook2 Doc Server

are all in separate columns. Even if I can grep each column into a separate file which is then copied into the spreadsheet...

Like I said, I'm sure it's a real easy one Smilie

Cheers in advance
Martin
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

using Grep for only a certain number of columns

I am given a file with a list of names for the first 20 characters. The 20 characters after is a list of names that somebody is supposed to team up with. Now i'm trying to write a simple script that will read a name somebody inputs and then looks only in the first 20 characters. For example.... (2 Replies)
Discussion started by: MaestroRage
2 Replies

2. UNIX for Advanced & Expert Users

Grep all the columns based on a particular column

This is the data file that I have 21879, 0, 22, 58, 388 0, -1, 300, 1219172589765, 1708, 0, 200, 21891, 0, 0, 33, 309 0, -1, 300, 1219172591478, 1768, 0, 200, 22505, 0, 0, 33, 339 0, -1, 300, 1219172593251, 1738, 0, 200, 21888, 0, 1, 33, 308 0, -1, 300, 1219172594995, 633, 0, 200, 24878,... (2 Replies)
Discussion started by: pmallur
2 Replies

3. Shell Programming and Scripting

grep required data from two columns

hello, I have output from a command and I need to filter some info out of that. I tried awk command but I can not grep what I am looking for: Following is the output and I need to capture "disabled" for each volume from first column and report: # vol status Volume State ... (2 Replies)
Discussion started by: za_7565
2 Replies

4. Shell Programming and Scripting

Grep based on specific columns.

Hi, How can I grep a record for a value based on specific column. If I simply do a grep 'AB' FilenName.txt, I might end up getting the records returned whose part of value is 'AB'. But I want it specific to second column. cut -d'|' -f 2 FileName.txt | grep 'AB' But now it will return... (1 Reply)
Discussion started by: deepakwins
1 Replies

5. UNIX for Dummies Questions & Answers

grep only from a range of columns

Hello all, I have a .csv file with over 100 columns. I would like to grep for a pattern only searching within a range of those fields, and print the entire line. For example: grep a pattern from columns $47-$87, but print fields $0 - $100 Thanks! (9 Replies)
Discussion started by: torchij
9 Replies

6. Shell Programming and Scripting

grep on columns

Hi, my data is this way abc def 01000000 kil ghi 23 01000000 kim ghj 0000 01000000 omg now, I would like to replace 01000000 on the third column as 0. I have a file with that value in different columns. So, any awk one liner that can let me change the column $ value would be highly... (4 Replies)
Discussion started by: jacobs.smith
4 Replies

7. Shell Programming and Scripting

Grep and convert into columns

I have 1000 different autosys jobs, want to extract only this information using unix commands. Tried with normail greping but unable to make columns into rows. Input: /* ----------------- template ----------------- */ insert_job: template job_type: c box_name: box1 command:... (3 Replies)
Discussion started by: onesuri
3 Replies

8. Shell Programming and Scripting

Grep and print only certain columns from a row

Hi Friends, This is my input chr1 100 200 + gene_name "alpha"; protein_name "alpha"; level 2; tag "basic"; info "known"; chr1 245 290 + gene_name "alpha-1"; protein_name "alpha-2"; level 9; tag "basic"; info "uknown"; chr1 310 320 + gene_name "alpha"; protein_name "alpha-4"; level 2; info... (3 Replies)
Discussion started by: jacobs.smith
3 Replies

9. Shell Programming and Scripting

Grep in multiple columns

Hi All, One of my source file is having more than 100 columns. Now, I need to check the particular string in 75th,76th and 79th columns of the source file. If I find the particular string in above mentioned columns, then I need to print the entire record with line number. Kindly help... (2 Replies)
Discussion started by: suresh_target
2 Replies

10. UNIX for Dummies Questions & Answers

Grep in specific columns

I am trying to search a list of strings from a file and display the string as well as the column in the search file it was found. I dont care about the row. what is wrong with my script? while read line; do awk -v var="$line" '{for(i=1;i<NF;i++) if ($NF==$var) break; print $var FS $NF' }'... (3 Replies)
Discussion started by: senhia83
3 Replies
PSC(1)							      General Commands Manual							    PSC(1)

NAME
psc - prepare sc files SYNOPSIS
psc [-fLkrSPv] [-s cell] [-R n] [-C n] [-n n] [-d c] DESCRIPTION
Psc is used to prepare data for input to the spreadsheet calculator sc(1). It accepts normal ascii data on standard input. Standard out- put is a sc file. With no options, psc starts the spreadsheet in cell A0. Strings are right justified. All data on a line is entered on the same row; new input lines cause the output row number to increment by one. The default delimiters are tab and space. The column for- mats are set to one larger than the number of columns required to hold the largest value in the column. OPTIONS
-f Omit column width calculations. This option is for preparing data to be merged with an existing spreadsheet. If the option is not specified, the column widths calculated for the data read by psc will override those already set in the existing spreadsheet. -L Left justify strings. -k Keep all delimiters. This option causes the output cell to change on each new delimiter encountered in the input stream. The default action is to condense multiple delimiters to one, so that the cell only changes once per input data item. -r Output the data by row first then column. For input consisting of a single column, this option will result in output of one row with multiple columns instead of a single column spreadsheet. -s cell Start the top left corner of the spreadsheet in cell. For example, -s B33 will arrange the output data so that the spreadsheet starts in column B, row 33. -R n Increment by n on each new output row. -C n Increment by n on each new output column. -n n Output n rows before advancing to the next column. This option is used when the input is arranged in a single column and the spreadsheet is to have multiple columns, each of which is to be length n. -d c Use the single character c as the delimiter between input fields. -P Plain numbers only. A field is a number only when there is no imbedded [-+eE]. -S All numbers are strings. -v Print the version of psc SEE ALSO
sc(1) AUTHOR
Robert Bond PSC 7.16 19 September 2002 PSC(1)
All times are GMT -4. The time now is 01:25 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy