Sponsored Content
Top Forums Shell Programming and Scripting Search string at a particular position in a file Post 302865983 by greet_sed on Monday 21st of October 2013 03:54:24 AM
Old 10-21-2013
small update:
Code:
perl -lane 'print "$F[2]" if $F[0] =~ /jjh/ ' file

without condition it can match a pattern anywhere.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Print lines with search string at specific position

Hi Folks, I have a file with all fields defined by byte position, but any field can be empty so I cannot print lines based on a search of specific columns. I need to print all lines of this file where the string of two characters at byte position 100-101 contains the number 27. Any ideas? ... (4 Replies)
Discussion started by: HealthyGuy
4 Replies

2. Shell Programming and Scripting

search in finding position of a string in avariable

Hi, I have to find a text in a variable and need to get the position of it. say, a="This is Example Example1 xxx yyy Example" if i search for "Example" then i should get the location of the starting location "Example". and in next iteration it should give the location of next "Example" ... (2 Replies)
Discussion started by: smr_rashmy
2 Replies

3. Shell Programming and Scripting

Search for a string and replace the searched string in the same position

Hi All, My requisite is to search for the string "0108"(which is the year and has come in the wrong year format) in a particular column say 4th column in a tab delimited file and then replace it with 2008(the correct year format) in the same position where 0108 was found..The issue is the last... (15 Replies)
Discussion started by: ganesh_248
15 Replies

4. Shell Programming and Scripting

search a line and insert string into specific at position

Hi, guys. I have one question: How can I search for a line with certain string in it and then insert a string into this line? For example: There is a file called shadow, the contents of it are below: ************************** ... yuanz:VIRADxMsadfDF/Q:0:0:50:7:::... (9 Replies)
Discussion started by: daikeyang
9 Replies

5. UNIX for Dummies Questions & Answers

Search for a string and replace the searched string in the same position in samefile

Hi All, My requisite is to search for the string "0108"(which is the year and has come in the wrong year format) in a particular column say 4th column in a tab delimited file and then replace it with 2008(the correct year format) in the same position where 0108 was found in the same file..The... (27 Replies)
Discussion started by: ganesh_248
27 Replies

6. UNIX for Dummies Questions & Answers

Search a string in the file and then replace another string after that position

Hi I am looking for a particular string in a file.If the string exists, then I want to replace another string with some other text.Once replaced, search for the same text after that character position in the file. :wall: E.g: Actual File content: Hello Name: Nitin Raj Welcome to Unix... (4 Replies)
Discussion started by: dashing201
4 Replies

7. Shell Programming and Scripting

Search string position in a line

WeeksD1|$26.52|$26.52|03/02/2013|12.48|D1|1.09|0|0|0|0|0|.95|0|0|0|0|0|0|0|0|0|0|0|0|0|0||$0.00|$0.00||0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0||$0.00|$0.00||0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0||$0.00|$0.00||0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|$0.00|$0.00|$0.00|$0.00|$0.00|$0.00|$... (3 Replies)
Discussion started by: gavemani
3 Replies

8. Shell Programming and Scripting

Search a string in a text file and add another string at the particular position of a line

I am having a text file which is having more than 200 lines. EX: 001010122 12000 BIB 12000 11200 1200003 001010122 2000 AND 12000 11200 1200003 001010122 12000 KVB 12000 11200 1200003 In the above file i want to search for string KVB and add/replace... (1 Reply)
Discussion started by: suryanarayana
1 Replies

9. Shell Programming and Scripting

Search string within a file and list common words from the line having the search string

Hi, Need your help for this scripting issue I have. I am not really good at this, so seeking your help. I have a file looking similar to this: Hello, i am human and name=ABCD. How are you? Hello, i am human and name=PQRS. I am good. Hello, i am human and name=ABCD. Good bye. Hello, i... (12 Replies)
Discussion started by: royzlife
12 Replies

10. Shell Programming and Scripting

Search for a string at a particular position and replace with blank based on position

Hi, I have a file with multiple lines(fixed width dat file). I want to search for '02' in the positions 45-46 and if available, in that lines, I need to replace value in position 359 with blank. As I am new to unix, I am not able to figure out how to do this. Can you please help me to achieve... (9 Replies)
Discussion started by: Pradhikshan
9 Replies
XML2AG(1)							Programmer's Manual							 XML2AG(1)

NAME
xml2ag - XML to AutoGen Definiton Converter SYNOPSIS
xml2ag [-flag [value]]... [--opt-name [[=| ]value]]... [ <def-file> ] This program will convert any arbitrary XML file into equivalent AutoGen definitions, and invoke AutoGen. DESCRIPTION
This manual page briefly documents the xml2ag command. The template will be derived from either: * the --override-tpl command line option * a top level XML attribute named, "template" One or the other must be provided, or the program will exit with a failure message. The "base-name" for the output will similarly be either: * the --base-name command line option * the base name of the .xml file OPTIONS
-O file, --output=file Output file in lieu of AutoGen processing. By default, the output is handed to an AutoGen for processing. However, you may save the definitions to a file instead. -L dir, --templ-dirs=dir Template search directory list. This option may appear an unlimited number of times. Pass-through AutoGen argument -T tpl-file, --override-tpl=tpl-file Override template file. Pass-through AutoGen argument -l tpl-file, --lib-template=tpl-file Library template file. This option may appear an unlimited number of times. Pass-through AutoGen argument -b name, --base-name=name Base name for output file(s). Pass-through AutoGen argument --definitions=file Definitions input file. Pass-through AutoGen argument -S file, --load-scheme=file Scheme code file to load. Pass-through AutoGen argument -F file, --load-functions=file Load scheme function library. Pass-through AutoGen argument -s suffix, --skip-suffix=suffix Omit the file with this suffix. This option may appear an unlimited number of times. Pass-through AutoGen argument -o suffix, --select-suffix[=suffix] specify this output suffix. This option may appear an unlimited number of times. Pass-through AutoGen argument --source-time set mod times to latest source. Pass-through AutoGen argument -m, --no-fmemopen Do not use in-mem streams. Pass-through AutoGen argument --equate=char-list characters considered equivalent. Pass-through AutoGen argument --writable, --not-writable Allow output files to be writable. The not-writable form will disable the option. Pass-through AutoGen argument --loop-limit=lim Limit on increment loops. This option takes an integer number as its argument. The value of lim is constrained to being: exactly -1, or in the range 1 through 0x1000000 The default lim for this option is: 256 Pass-through AutoGen argument -t time-lim, --timeout=time-lim Time limit for servers. This option takes an integer number as its argument. The value of time-lim is constrained to being: in the range 0 through 3600 Pass-through AutoGen argument --trace=level tracing level of detail. This option takes a keyword as its argument. The argument sets an enumeration value that can be tested by comparing them against the option value macro. The available keywords are: nothing debug-message server-shell templates block-macros expressions everything or their numeric equivalent. The default level for this option is: nothing Pass-through AutoGen argument --trace-out=file tracing output file or filter. Pass-through AutoGen argument --show-defs Show the definition tree. Pass-through AutoGen argument --used-defines Show the definitions used. Pass-through AutoGen argument -D value, --define=value name to add to definition list. This option may appear an unlimited number of times. Pass-through AutoGen argument -U name-pat, --undefine=name-pat definition list removal pattern. This option may appear an unlimited number of times. Pass-through AutoGen argument -?, --help Display usage information and exit. -!, --more-help Extended usage information passed thru pager. -v [{v|c|n}], --version[={v|c|n}] Output version of program and exit. The default mode is `v', a simple version. The `c' mode will print copyright information and `n' will print the full copyright notice. AUTHOR
Bruce Korb Please send bug reports to: autogen-users@lists.sourceforge.net Released under the GNU General Public License. This manual page was AutoGen-erated from the xml2ag option definitions. (GNU AutoGen 5.9.7) 2010-07-05 XML2AG(1)
All times are GMT -4. The time now is 11:50 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy