Sponsored Content
Full Discussion: Egrep multi rows
Top Forums UNIX for Dummies Questions & Answers Egrep multi rows Post 302915128 by RavinderSingh13 on Monday 1st of September 2014 04:36:55 AM
Old 09-01-2014
Hello,

One more approach with awk using variables.

Code:
awk -F"|" '$5==s1 || $5==s2 {print}' s1="13127" s2="13140" filename

Output will be as follows.

Code:
20140730|13|TORONTO|Pavja|13127|Moto|0|1568|2035|-467|59478|352450|2014-08-11 23:12:15
20140730|13|TORONTO|Pavja|13127|Manual|0|696|742|-46|38826|141449|2014-08-11 23:12:15
20140730|13|TORONTO|Pavja|13127|Semimanual|0|0|3|-3|0|317|2014-08-11 23:12:15
20140730|13|TORONTO|Pavja|13127||0|376|31|345|19171|19776|2014-08-11 23:12:15
20140731|13|OTTAWA|City Earth|13140|Moto|0|0|103|-103|0|61086|2014-08-11 23:12:15
20140731|13|OTTAWA|City Earth|13140|Manual|0|0|10|-10|7|12798|2014-08-11 23:12:15
20140731|13|OTTAWA|City Earth|13140|Semimanual|0|0|0|0|0|237|2014-08-11 23:12:15
20140731|13|OTTAWA|City Earth|13140||0|1|0|1|81|189|2014-08-11 23:12:15


Thanks,
R. Singh
This User Gave Thanks to RavinderSingh13 For This Post:
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

multi-file multi-edit

Good day! I am trying to learn how to use the "sed" editor, to perform multiple edits on multiple files in multiple directories. I have one script that tries to call up each file and process it according to the edits listed in a second script. I am using a small input text to test these, at... (12 Replies)
Discussion started by: kielitaide
12 Replies

2. UNIX for Dummies Questions & Answers

Multi User Multi Task

Dear Experts Why we always hear that unix operating system is Multi User and Multi task. What does these two means. I have looked at some books and documents but couldn't find aclear explenation. Can we say Windows operating system is also multi user and multi task?? Thanks for your help in... (6 Replies)
Discussion started by: Reza Nazarian
6 Replies

3. UNIX for Dummies Questions & Answers

Egrep cheat sheet anywhere? Looking for meaning of egrep -c

Hi I've been searching google and have not found what egrep -c means. Does anyone know where I can get a cheat sheet or what that -c means? thanks, Linda (2 Replies)
Discussion started by: leelm
2 Replies

4. UNIX for Dummies Questions & Answers

search ")" with egrep - egrep: syntax error

Hi Guys, we have a shell script which basically query the Database which retrieves huge data and use the data with "egrep" . Now there is some data which contains characters like "abc)" and the same is used like below : "egrep (.+\|GDPRAB16\|GDPR/11702 96 abc)\|$ temp.txt" now while... (7 Replies)
Discussion started by: sagarjani
7 Replies

5. UNIX for Dummies Questions & Answers

find and remove rows from file where multi occurrences of character found

I have a '~' delimited file of 6 - 7 million rows. Each row should contain 13 columns delimited by 12 ~'s. Where there are 13 tildes, the row needs to be removed. Each row contains alphanumeric data and occasionally a ~ ends up in a descriptive field and therefore acts as a delimiter, resulting in... (1 Reply)
Discussion started by: kpd
1 Replies

6. Shell Programming and Scripting

Sort the multi column rows

abc xyz - - - - - - - - - - - How to sort the second column in ascending order. (2 Replies)
Discussion started by: sandy1028
2 Replies

7. Shell Programming and Scripting

How to substract selective values in multi row, multi column file (using awk or sed?)

Hi, I have a problem where I need to make this input: nameRow1a,text1a,text2a,floatValue1a,FloatValue2a,...,floatValue140a nameRow1b,text1b,text2b,floatValue1b,FloatValue2b,...,floatValue140b look like this output: nameRow1a,text1b,text2a,(floatValue1a - floatValue1b),(floatValue2a -... (4 Replies)
Discussion started by: nricardo
4 Replies

8. Programming

Multi head/multi window hello world

I am trying to write a large X app. I have successfully modified my xorg.conf to setup 4 monitors on an NVIDIA Quatro5200. I am trying to modify a simple hello world application to open a window on three of the four monitors. depending on the changes to loop the window creation section and event... (2 Replies)
Discussion started by: advorak
2 Replies

9. Programming

DB2 Query -Convert multi values from column to rows

Hi Team I am using DB2 artisan tool and struck to handle multi values present in columns that are comma(,) separated. I want to convert those column values in separate rows . For example : Column 1 Column2 Jan,Feb Hold,Sell,Buy Expected Result Column1 ... (3 Replies)
Discussion started by: Perlbaby
3 Replies

10. Shell Programming and Scripting

Help with reformat single-line multi-fasta into multi-line multi-fasta

Input File: >Seq1 ASDADAFASFASFADGSDGFSDFSDFSDFSDFSDFSDFSDFSDFSDFSDFSD >Seq2 SDASDAQEQWEQeqAdfaasd >Seq3 ASDSALGHIUDFJANCAGPATHLACJHPAUTYNJKG ...... Desired Output File >Seq1 ASDADAFASF ASFADGSDGF SDFSDFSDFS DFSDFSDFSD FSDFSDFSDF SD >Seq2 (4 Replies)
Discussion started by: patrick87
4 Replies
obd2kml(1)						      General Commands Manual							obd2kml(1)

NAME
obd2kml - Convert obdgpslogger(1) logs to Google Earth kml files SYNOPSIS
obd2kml [ options ] DESCRIPTION
Convert obdgpslogger(1) logs to Google Earth kml files OPTIONS
-o|--out <output filename> Output to this .kml file -a|--altitude <altitude> In the kml file, normalise the graph to this height -d|--db <database> Work from logs stored in this database file -n|--name <folder name> Everything in this output file is wrapped in a folder named this -v|--version Print out version number and exit. -h|--help Print out help and exit. NOT OPTIONS
These options aren't intended for end-users, they're for the GUI. -p|--progress Print out progress. It will occasionally print a number in the range [0..100], indicating progress percentage. SEE ALSO
obdgpslogger(1), obd2csv(1), obd2gpx(1), obdsim(1), obdgui(1), obdlogrepair(1) AUTHORS
Gary "Chunky Ks" Briggs <chunky@icculus.org> obd2kml(1)
All times are GMT -4. The time now is 07:24 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy