Sponsored Content
Top Forums Shell Programming and Scripting How to replace value in each field until a certain character in each record? Post 303027942 by sudhakar1987 on Friday 28th of December 2018 11:47:41 AM
Old 12-28-2018
Thanks for the response vgersh99 . Honestly, I am new to using unix. I tried some options with awk but the results are not matching with my requirement. Any help would be appreciated.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

how to replace field for each record

Hello, I have the following xml formatted file. I would like to get the newnumber field number and replace into customernumber for each record. For example: <XMLFORMAT> <customernumberR11>9</customernumberR11> ... (12 Replies)
Discussion started by: happyv
12 Replies

2. Shell Programming and Scripting

Replace third field of the first record in a file....

Hi, I am new to unix and am trying to do something below: I have a pipe delimited file with millions of records. I need to replace the third column of the first record to the number of lines in the file. How can I do that. Will appreciate any advice and help. Thanks Simi (3 Replies)
Discussion started by: simi28
3 Replies

3. Shell Programming and Scripting

Replace comma by space for specified field in record

Hi, i want to replace comma by space for specified field in record, i mean i want to replace the commas in the 4th field by space. and rest all is same throught the record. the record is 16458,99,001,"RIMOUSKI, QC",418,"N",7,EST,EDT,902 16458,99,002,"CHANDLER,... (5 Replies)
Discussion started by: raghavendra.cse
5 Replies

4. Shell Programming and Scripting

Count number of occurences of a character in a field defined by the character in another field

Hello, I have a text file with n lines in the following format (9 column fields): Example: contig00012 149606 G C 49 68 60 18 c$cccccacccccccccc^c I need to count the number of lower-case and upper-case occurences in column 9, respectively, of the... (3 Replies)
Discussion started by: s052866
3 Replies

5. Shell Programming and Scripting

Replace field in one file with whole record data of another

Hello Group, I need to replace the city field in “File 1 (fileld 3), with the entire record line of “File 2” (including delimiters) where the “city” field (File 1, Field 3)matches city field (File 2, Field1). All of the other data in “File 1” should remain intact(Fields 1,2,4,5,6). Only field... (1 Reply)
Discussion started by: vestport
1 Replies

6. Shell Programming and Scripting

Replace a field with a character as per the field length

Hi all, I have a requirement to replace a field with a character as per the length of the field. Suppose i have a file where second field is of 20 character length. I want to replace second field with 20 stars (*). like ******************** As the field is not a fixed one, i want to do the... (2 Replies)
Discussion started by: gani_85
2 Replies

7. Shell Programming and Scripting

Extract timestamp from first record in xml file and it checks if not it will replace first record

I have test.xml <emp><id>101</id><name>AAA</name><date>06/06/14 1811</date></emp> <Join><id>101</id><city>london</city><date>06/06/14 2011</date></join> <Join><id>101</id><city>new york</city><date>06/06/14 1811</date></join> <Join><id>101</id><city>sydney</city><date>06/06/14... (2 Replies)
Discussion started by: vsraju
2 Replies

8. Shell Programming and Scripting

Display combination of 4 field uniqe record and along with concatenate 5th and 6th field.

Table ACN|NAME|CITY|CTY|NO1|NO2 115|AKKK|ASH|IND|10|15 115|AKKK|ASH|IND|20|20 115|AKKK|ASH|IND|30|35 115|AKKK|ASH|IND|30|35 112|ABC|FL|USA|15|15 112|ABC|FL|USA|25|20 112|ABC|FL|USA|25|45 i have written shell script using cut command and awk programming getting error correct it and add... (5 Replies)
Discussion started by: udhal
5 Replies

9. Shell Programming and Scripting

Replace a string for every record after the 1st record

I have data coming in the below format for each record <?xml version="1.0" encoding="UTF-8" standalone="no"?><test_sox xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><testdetials>....</test_sox> <?xml version="1.0" encoding="UTF-8" standalone="no"?><test_sox... (8 Replies)
Discussion started by: dsravanam
8 Replies

10. Shell Programming and Scripting

How to repeat a character in a field if it's a single character?

I have a csv dataset like this : C,rs18768 G,rs13785 GA,rs1065 G,rs1801279 T,rs9274407 A,rs730012 I'm thinking of use like awk, sed to covert the dataset to this format: (if it's two character, then keep the same) CC,rs18768 GG,rs13785 GA,rs1065 GG,rs1801279 TT,rs9274407... (7 Replies)
Discussion started by: nengcheng
7 Replies
OPENSEARCH-GENQUERY(1)					User Contributed Perl Documentation				    OPENSEARCH-GENQUERY(1)

NAME
opensearch-genquery - Output the URL of a query generated from an OpenSearch Description SYNOPSIS
opensearch-genquery [-q] [-H] [-A] [-R] [-c COUNT] [-i INDEX] [-p PAGENUM] [-l LANG] [-O ENC] [-I ENC] URL SEARCH TERMS... DESCRIPTION
Output the URL of a query generated from an OpenSearch Description file at URL, with the specified SEARCH TERMS and other options filled in. If multiple search types are available, -H, -A and -R can be used to specify which type is wanted. For example, -A -R can be used to request an Atom response, or failing that fall back to RSS. By default the first URL found in the description file is used. Not all web sites implement all (or any) of the optional OpenSearch parameters. When used with those sites, the corresponding options will be silently ignored. OPTIONS
-q Give no output on errors. In this case, consult the exit code to determine errors (See "DIAGNOSTICS"). -H Request HTML response. -A Request Atom response. -R Request RSS response. -H, -A, and -R can be combined to express response type priority and specify fallback types. -c COUNT, --count=COUNT Request COUNT results. OpenSearch parameter: count. -i INDEX, --startindex=INDEX Request results start at offset NUM. OpenSearch parameter: startIndex. -p PAGENUM, --startpage=PAGENUM Request results page PAGENUM. OpenSearch parameter: pageIndex. -l LANG, --language=LANG Request results in LANG. LANG should be a 2-letter ISO country code (e.g. en or de). OpenSearch parameter: language. -O ENC, --outputencoding=ENC Request results encoded in ENC (default: UTF-8). OpenSearch parameter: outputEncoding. -I ENC, --inputencoding=ENC Specify search terms are encoded in ENC (default: UTF-8). OpenSearch parameter: inputEncoding. -h, --help Show a short help message. -- End of options. DIAGNOSTICS
The exit code can be consulted to determine errors, as follows: 0 - Success. 1 - Error fetching OpenSearch Description URL. 2 - Error parsing OpenSearch Description. 3 - No matching search type found. 4 - Cannot find perl module WWW::OpenSearch. 5 - Unhandled error from WWW::OpenSearch. DEPENDENCIES
Requires the module WWW::OpenSearch (Debian package libwww-opensearch-perl). BUGS
Only supports GET queries. Please report any bugs found to ianb@erislabs.net SEE ALSO
opensearch(1), opensearch-discover(1), surfraw(1), WWW::OpenSearch(3pm), <http://www.opensearch.org/> AUTHOR
Ian Beckwith <ianb@erislabs.net> COPYRIGHT AND LICENSE
Copyright 2006 Ian Beckwith <ianb@erislabs.net> Licensed under the same terms as surfraw. perl v5.12.4 2011-07-12 OPENSEARCH-GENQUERY(1)
All times are GMT -4. The time now is 04:26 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy