Sponsored Content
Full Discussion: Issue with Grep
Top Forums UNIX for Dummies Questions & Answers Issue with Grep Post 302961035 by NickF on Monday 23rd of November 2015 08:27:31 AM
Old 11-23-2015
Hi RudiC,

Embarrassingly, the problem turned out to be nothing to do with the code! The issue was that I was using the wrong file! Smilie

Still, confirmation that the Grep was OK helped cause it made me look elsewhere in the coding.

Sorry to have wasted your time on that.

Thanks
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

issue with grep

using grep, i have a file emp.lst, and i want all those records where "S" or "s" (capital or small) is not there i used this grep emp.lst when i use grep emp.lst i am getting rows with S..but why negate (^) is not working? (3 Replies)
Discussion started by: soujanya_srk
3 Replies

2. UNIX for Dummies Questions & Answers

Issue with grep

I have a file that has the following: 591066 100.0 591066 100.0 591066 100.0 591066 100.0 591066 100.0 591066 100.0 591066 100.0 591066 100.0 591066 100.0 591066 100.0 591066 100.0 ... (5 Replies)
Discussion started by: Pablo_beezo
5 Replies

3. Shell Programming and Scripting

Grep Issue

<record> <set> <termId>1234</termId> <termType>First</termType> </set> <set> <termId>5678</termId> <termType>Second</termType> </set> </record> This is saved in record.xml Hi I have this sample XML that i am grepping using a shell program. The objective of the task is - based... (7 Replies)
Discussion started by: revertback
7 Replies

4. Shell Programming and Scripting

grep issue

The below command is not working stackmem="$(pmap $1 | grep -i '' | awk '{print $2}'| tr -d ' K')" I need to grep strictly for ----> Regards, Mohtashim (2 Replies)
Discussion started by: mohtashims
2 Replies

5. UNIX for Dummies Questions & Answers

Grep issue

more Hello.txt it was a sunny way and i was about to go home. I need to grep and redirect to a new file all the text between 'sunny' and 'go' string above. Note: There may be multiple lines in between the string i need to grep between. If there are multiple 'go' strings it should grep till... (9 Replies)
Discussion started by: mohtashims
9 Replies

6. Shell Programming and Scripting

Grep issue

Hi All I have a file containing following records: $HEW_TGT_DB2_USER=hbme_bi2 $prmAttunityUser=ais $DS_USER=hbme_bi2 $prmStgUser=hbme_bi2 $prmuser=hbme_bi2 $prmStgPass=hbme_bi2 $prmpwd=hbme_bi2 $prmAttunityUser=ais Say suppose the name of the file is test4.txt When i fire this... (2 Replies)
Discussion started by: vee_789
2 Replies

7. Shell Programming and Scripting

Issue in grep

i have following pattern in file s6:s2 s2:s4 s1:s2:s3:s4:s5:s6 s1 . . Now i want to find occurence of each record in file like s6:s2 occurs twice {once in first record and both occur in 3 record as well} so output should be s6:s2 2 s2:s4 2 s1:s2:s3:s4:s5:s6 :1 s1 : 2 ... (7 Replies)
Discussion started by: sharad.40216
7 Replies

8. Shell Programming and Scripting

Grep issue

Hi Guys, I am new to shell scripting. Need help on grep command. I had a file called file.log which contain below statements. 12 Nov 2013 14:12:17,756 INFO security - Userid: raja, Saved File Instance, Name: , Registry: 23 Nov 2013 14:14:11,777 INFO security - Userid: raja, Saved... (7 Replies)
Discussion started by: Vinoth Kumar G
7 Replies

9. UNIX for Dummies Questions & Answers

Grep issue

HI, I have a command to check a license file. License_print. In that file you get the headlines and all different licenses. Now i want to have things extracted from it. so i do like following: license_print | grep -iw -e "user" -e "admin" But i donīt want all lines where user is... (11 Replies)
Discussion started by: Tzwaj
11 Replies

10. Shell Programming and Scripting

Issue with grep

Hello, I have an input file that looks like so: LDLR LDLRAD4 VLDLR when I grep "LDLR" I get an output of: LDLR LDLRAD4 VLDLR Since all names have "LDLR" included within them, but all I want the output to be is LDLR I know it can work if I surround the words with pipes for... (5 Replies)
Discussion started by: Rabu
5 Replies
LV(1)							      General Commands Manual							     LV(1)

NAME
lv - a Powerful Multilingual File Viewer / Grep SYNOPSIS
lv, lgrep lv -h lv -V lv [-acdfgiklmnqsuvz] [+acdfgiklmnqsuvz] [-Acoding-system] [-Icoding-system] [-Kcoding-system] [-Ocoding-system] [-Pcoding-system] [-Dcoding-system] [-Ssseq] [-Srseq] [-Sbseq] [-Suseq] [-Shseq] [-Tnumber] [-Wwidth] [-Hheight] [-E'editor'] [-+] [+number] [+/grep-pattern] [-] (grep-pattern) [files ...] DESCRIPTION
Multilingual file viewer lv is a powerful multilingual file viewer. Apparently, lv looks like less (1), a representative file viewer on UNIX as you know, so UNIX people (and less people on other OSs) don't have to learn a burdensome new interface. lv can be used on MSDOS ANSI terminals and almost all UNIX platforms. lv is a currently growing software, so your feedback is welcome and helpful for us to refine the future lv. Multiple coding systems lv can decode and encode multilingual streams through many coding systems, for example, ISO 2022 based coding systems such as iso-2022-jp, and EUC (Extended Unix Code) like euc-japan. Furthermore, localized coding systems such as shift-jis, big5 and HZ are also supported. lv can be used not only as a file viewer but also as a coding-system translation filter like nkf (1) and tcs (1). Multilingual regular expressions / Multilingual grep lv can recognize multi-bytes patterns as regular expressions, and lv also provides multilingual grep (1) functionality by giving it another name, lgrep. Pattern matching is conducted in the charset level, so an EUC fragment, for example, can be found in the ISO 2022 tailored streams, of course. Supporting the Unicode standard lv provides Unicode facilities which enables you to handle Unicode streams encoded in UTF-7 or UTF-8, and lv can also convert their code-points between Unicode and other charsets. So you can display Unicode or foreign texts on your terminal, using the code con- version function to your favorite charsets via Unicode. (However, MSDOS version of lv has none of the Unicode facility.) ANSI escape sequence through lv can recognize ANSI escape sequences for text decoration. So you can look ANSI-decorated streams such as colored source codes generated by another software just like intended image on ANSI terminals. Completely original lv is a completely original software including no code drawn from less and grep and other programs at all. OPTIONS
-A<coding-system> Set all coding systems to coding-system. -I<coding-system> Set input coding system to coding-system. -K<coding-system> Set keyboard coding system to coding-system. If it is not set, output coding system will be applied to it. -O<coding-system> Set output coding system to coding-system. -P<coding-system> Set pathname coding system to coding-system. -D<coding-system> Set default (fall-back) coding system to coding-system. coding-system: a: auto-select c: iso-2022-cn j: iso-2022-jp k: iso-2022-kr ec: euc-china ej: euc-japan ek: euc-korea et: euc-taiwan u7: UTF-7 u8: UTF-8 l1..9: iso-8859-1..9 l0: iso-8859-10 lb,ld,le,lf,lg: iso-8859-11,13,14,15,16 s: shift-jis b: big5 h: HZ r: raw mode Examples: -Il2: input coding system is iso-8859-2 -Ks: keyboard coding system is shift-jis -Oek: output coding system is euc-korea -Ab: all coding systems are big5 Coding-system translations / Code-points conversions: iso-2022-cn, -jp, -kr can be converted into euc-china or -taiwan, euc-japan, euc-korea, respectively (and vice versa). shift-jis uses the same internal code-points as iso-2022-jp and euc-japan. Since big5 characters can be converted into CNS 11643-1992 with negligible incompleteness, big5 streams can be translated into iso-2022-cn or euc-taiwan (and vice versa) with code-points conversion. Note that the iso-2022-cn referred here is not GB sequence, only just CNS one. You should remember that lv cannot translate big5 into GB directly. The search function of lv may not work correctly when lv additionally performs ``code-points'' conversion (not ``coding-system'' translation), because visible code and internal code are different from each other. lv will try to avoid this problem with convert- ing charsets of search patterns automatically, but this function is not always perfect. -W<number> Screen width -H<number> Screen height -E'<editor>' (default 'vi -c %d') Editor name (default 'vi -c %d') ``%d'' means the line number of current position in a file. -q Assert there is delete/insert-lines control. Please set this option on a MSDOS ANSI terminal that has capability to delete and/or insert lines. As to termcap and terminfo ver- sion, it will be set automatically. -Ss<seq> Set ANSI Standout sequence to seq (default "7") -Sr<seq> Set ANSI Reverse sequence to seq (default "7") -Sb<seq> Set ANSI Blink sequence to seq (default "5") -Su<seq> Set ANSI Underline sequence to seq (default "4") -Sh<seq> Set ANSI Highlight sequence to seq (default "1") These sequences are inserted between ``ESC ['' and ``m'' to construct full ANSI escape sequences. -T<number> Set Threshold-code which divides Unicode code-points in two regions. Characters belonging to the lower region are assumed to have a width of one, and the higher characters are equated to a width of two. (Default: 12288, = 0x3000) -m Force Unicode code-points which have the same glyphs as iso-8859-* to be Mapped to iso-8859-* in a conversion from Unicode to another character set which also has the corresponding code-points, in particular, Asian charsets. -a Adjust character set for search pattern (default) -c Allow ANSI escape sequences for text decoration (Color) -d, -i Make regexp-searches ignore case (case folD search) (default) -f Substitute Fixed strings for regular expressions -k Convert X0201 Katakana to X0208 while decoding -l Allow physical lines of each logical line printed on the screen to be concatenated for cut and paste after screen refresh -s Force old pages to be swept out from the screen Smoothly -u Unify several character sets, eg. JIS X0208 and C6226. In addition, lv equates ISO 646 variants, eg. JIS X0201-Roman, and unknown charsets with ASCII. -g Turn on lgrep mode. -n Prefix each line of output with the line number within its input file on lgrep. -v Invert the sense of matching on lgrep. -z Enable HZ auto-detection (also enabled by run-time C-t). -+ Clear all options You can also turn OFF specified options, using ``+<option>'' like +c, +d, ... +z. - Treat the following arguments as filenames grep-pattern lv works like grep (1) when its name is lgrep +number Jump to the specified line immediately when lv is invoked. +/grep-pattern Search the specified pattern immediately when lv is invoked. -V Show lv version -h Show this help CONFIGURATION
Options can be described in configuration file ``.lv'' (``_lv'' on MSDOS) located at you HOME directory. If and only if you use MSDOS, you can locate ``_lv'' at current working directory. They can be also described in the environment variable LV. Every configuration will be overloaded in this order if there is. Command line options are always read finally. COMMAND KEY BINDINGS
0..9: Argument g, <: Jump to the line number (default: top of the file) G, >: Jump to the line number (default: bottom of the file) p: Jump to the percentage position in line numbers (0-100) b, C-b: Previous page u, C-u: Previous half page k, w, C-k, y, C-y, C-p: Previous line j, C-j, e, C-e, C-n, CR: Next line d, C-d: Next half page f, C-f, C-v, SP: Next page F: Jump to the end of file, and wait for a data to be appended to the file until interrupted. /<string>: Find a string in the forward direction (regular expression) ?<string>: Find a string in the backward direction (regular expression) n: Repeat previous search in forward direction N: Repeat previous search in backward direction (not REVERSE) C-l: Redisplay all lines r, C-r: Refresh screen and memory R: Reload current file :n: Examine the next file :p: Examine the previous file t: Toggle input coding systems T: Toggle input coding systems reversely C-t: Toggle HZ decoding mode v: Launch the editor defined by option -E C-g, =: Show file information (filename, position, coding system) V: Show LV version C-z: Suspend (call SHELL or ``command.com'' under MSDOS) q, Q: Quit UP/DOWN: Previous/Next line LEFT/RIGHT: Previous/Next half page PageUp/PageDown: Previous/Next page HOW TO INPUT SEARCH STRINGS
? C-m, Enter: Enter the current string C-h, BS, DEL: Delete one character (backspace) C-u: Cancel the current string and try again C-p: Restore a few old strings incrementally (history) C-g: Quit REGULAR EXPRESSION
Special characters are ^, $, ., *, +, ?, [, ^, -, ], . | specifies an alternative. (, ) is a grouping construct. 1 and 2 matches any charset consists of one- or two- column(s) characters respectively. Mutually overlapping ranges (or charset) are not guaranteed. SEE ALSO
LV Homepage: http://www.ff.iij4u.or.jp/~nrt/lv/ COPYRIGHT
All rights reserved. Copyright (C) 1996-2004 by NARITA Tomio. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MER- CHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA BUG REPORT
Please send bug reports to: nrt@ff.iij4u.or.jp v.4.51 (Jan.16th,2004) LV(1)
All times are GMT -4. The time now is 01:09 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy