Sponsored Content
Top Forums UNIX for Dummies Questions & Answers parse multiple lines? should be a easy answer... Post 302155521 by DeuceLee on Friday 4th of January 2008 09:52:42 AM
Old 01-04-2008
Data parse multiple lines? should be a easy answer...

inputfile:

A B C D
E F G H
1 2 3 4

-----------

I want to read these and put them into a variable:

file=../inputfile
col2line1=`cat $file | awk '{print $2}'`

how do i extract row 2's E,F,G,H or row 3's 1,2,3,4???

I tried the search, didn't get much, maybe i suck at searching too Smilie
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Need help on installing an EASY to use and easy to install command line text editor

Hi again. Sorry if it seems like I'm spamming the boards a bit, but I figured I might as well ask all the questions I need answers to at once, and hopefully at least get some. I have installed Solaris 10 on a server. The default text editors are there (vi, ex, ed, maybe others, I know emacs is... (4 Replies)
Discussion started by: EugeneG
4 Replies

2. Shell Programming and Scripting

parse of lines with different delimiters

Hi, I am having huge file with the following lines. 2007:10:01:00:00:49:GMT: subject=BMRA.BM.T_ABTH7.FPN, message={SD=2007:10:01:00:00:00:GMT,SP=5,NP=2,TS=2007:10:01:01:00:00:GMT,VP=0.0,TS=2007:10:01:01:30:00:GMT,VP=0.0} 2007:10:01:00:00:49:GMT: subject=BMRA.BM.T_ABTH7G.FPN,... (9 Replies)
Discussion started by: nathasha
9 Replies

3. Shell Programming and Scripting

Parse and count lines

I have a data file in the following format (refer to input file) with multiple lines containing some information. I need an output file to loop thorough the input file with summarized information as seen below (refer to output file) ‘Date Time' and ‘Beta Id' input file values should be concatenated... (7 Replies)
Discussion started by: shekharaj
7 Replies

4. Shell Programming and Scripting

Parse and delete lines efficiently

Hi I have a set of options in the form of key value in a file. Need to find a particular value of 'a' and delete all lines till the next 'a' keyword . Ex : a bbb c ddd e fff g hhh a sss c ggg e xxx f sss a ddd d sss r sss g hhh (5 Replies)
Discussion started by: TDUser
5 Replies

5. Shell Programming and Scripting

Parse out specific lines

Hello, For the life of me, I can't figure out how to extract only certain lines of a file. For example, the file contains: project.max-sem-ids privileged 1.02K - deny - system 16.8M max deny ... (2 Replies)
Discussion started by: PointyWombat
2 Replies

6. UNIX for Dummies Questions & Answers

How to parse 2 particular lines from Command output

Hi All, I need help on the following req. I am getting output of a command as follows: 16377612 total memory 3802460 used memory 2827076 active memory 681948 inactive memory 12575152 free memory 477452 buffer memory I want to compute used... (1 Reply)
Discussion started by: mailsara
1 Replies

7. Shell Programming and Scripting

parse lines

I have file which is having 500 lines. I want to get the first 100 lines then sleep, then again next 100 lines sleep so now till the end of the file. Can someone tell me in perl and bash. also i want to do it in threads. Thanks.. (6 Replies)
Discussion started by: Anjan1
6 Replies

8. Shell Programming and Scripting

How do I parse file with multiple different columns ?

I have a tool which generates results in a file at every minute and which has following columns. I need to create a script checks this file constantly and if Column ( QOM ) has value more then "30S" it should send an email. Can anybody help ? Thansk a lot. Time MxML MxQD G P OIC OUC MDC... (11 Replies)
Discussion started by: jayeshpatel
11 Replies

9. Shell Programming and Scripting

awk to parse multiple lines

What is the correct syntax to have the awk parse the next line as well? The next in bold is where I think it should go, but I wanted to ask the experts since I am a beginner. The file to be parsed is attached as well. Thank you :). awk 'NR==2 {split($2,a,"");b=substr(a,1,length(a-1));print... (6 Replies)
Discussion started by: cmccabe
6 Replies

10. Shell Programming and Scripting

Removing multiple lines from input file, if multiple lines match a pattern.

GM, I have an issue at work, which requires a simple solution. But, after multiple attempts, I have not been able to hit on the code needed. I am assuming that sed, awk or even perl could do what I need. I have an application that adds extra blank page feeds, for multiple reports, when... (7 Replies)
Discussion started by: jxfish2
7 Replies
GOMOKU(6)							 BSD Games Manual							 GOMOKU(6)

NAME
gomoku -- game of 5 in a row SYNOPSIS
gomoku [-bcdu] [-D debugfile] [inputfile] DESCRIPTION
gomoku is a two player game were the object is to get 5 in a row horizontally, vertically or diagonally on a 19 by 19 grid. By convention, black always moves first. With no arguments, gomoku will display a playing board and prompt for moves from the user. Valid moves are a let- ter for the column and a number for the row of an empty board location. Entering ``quit" or ``resign" will end the game. You can save the current state of the game by entering ``save" and supplying a file name when prompted. The optional file inputfile can be used to restore a saved game. The options are: -b This option sets background mode. Input moves are read from standard input, the computer picks a move, and prints it to standard output. The first input line should be either ``black" or ``white" to specify whether gomoku has the first move or not respectively. This option was intended for game tournaments where a referee program handles the board display and pits one program against another. -c Computer versus computer. gomoku will play a game against itself. This is mostly used for testing. -d Print debugging information. Repeating this option more than once yields more detailed information. -D debugfile Print the debug information to debugfile instead of to the standard output. -u User versus user. This is mostly used for testing. AUTHOR
Ralph Campbell ACKNOWLEDGEMENTS
The board display routines were based on the goref program written by Peter Langston. BSD
August 4, 1994 BSD
All times are GMT -4. The time now is 04:29 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy