Sponsored Content
Top Forums Shell Programming and Scripting stampare righe precedenti ad un match in file Post 302340743 by zaxxon on Tuesday 4th of August 2009 09:16:45 AM
Old 08-04-2009
Hello.

Per our forum rules, all posts must be in English.

We do provide translation services for posts from English to a number of languages as a benefit to users. However, posts must be in English.

Please repost in English.

Thank you for your cooperation.

The UNIX and Linux Forums.


Also use CODE tags when posting code, data or logs, ty.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to find first match and last match in a file

Hi All, I have a below file: ================== 02:53 pravin-root 02:53 pravin-root 03:05 pravin-root 02:55 pravin1-root 02:59 pravin1-root ================== How do I find the first and last value of column 1. For example, how do I find 02:53 is the first time stamp and 03:05 is... (3 Replies)
Discussion started by: praving5
3 Replies

2. Shell Programming and Scripting

Strings from one file which exactly match to the 1st column of other file and then print lines.

Hi, I have two files. 1st file has 1 column (huge file containing ~19200000 lines) and 2nd file has 2 columns (small file containing ~6000 lines). ################################# huge_file.txt a a ab b ################################## small_file.txt a 1.5 b 2.5 ab ... (4 Replies)
Discussion started by: AshwaniSharma09
4 Replies

3. Shell Programming and Scripting

estrarre più righe con awk da files html

salve a tutti, sono nuovo di questo forum e sono nuovo anche come shell scripter diciamo. il mio problema è quello di avere dei files html in una directory e da questi vorrei estrarre un dato che si trova tra due righe differenti Ecco la mia situazione <td align="default">ossidabilità (mg/l): ... (1 Reply)
Discussion started by: sbobotex
1 Replies

4. UNIX for Dummies Questions & Answers

Help with AWK - Compare a field in a file to lookup file and substitute if only a match

I have the below 2 files: 1) Third field from file1.txt should be compared to the first field of lookup.txt. 2) If match found then third field, file1.txt should be substituted with the second field from lookup.txt. 3)Else just print the line from file1.txt. File1.txt:... (4 Replies)
Discussion started by: venalla_shine
4 Replies

5. Shell Programming and Scripting

Match list of strings in File A and compare with File B, C and write to a output file in CSV format

Hi Friends, I'm a great fan of this forum... it has helped me tone my skills in shell scripting. I have a challenge here, which I'm sure you guys would help me in achieving... File A has a list of job ids and I need to compare this with the File B (*.log) and File C (extend *.log) and copy... (6 Replies)
Discussion started by: asnandhakumar
6 Replies

6. Shell Programming and Scripting

Match pattern1 in file, match pattern2, substitute value1 in line

not getting anywhere with this an xml file contains multiple clients set up with same tags, different values. I need to parse the file for client foo, and change the value of tag "64bit" from false to true. cat clients.xml <Client type"FIX"> <ClientName>foo</ClientName>... (3 Replies)
Discussion started by: jack.bauer
3 Replies

7. Shell Programming and Scripting

Display match or no match and write a text file to a directory

The below bash connects to a site, downloads a file, searches that file based of user input - could be multiple (all that seems to work). What I am not able to figure out is how to display on the screen match found or no match found" and write a file to a directory (C:\Users\cmccabe\Desktop\wget)... (4 Replies)
Discussion started by: cmccabe
4 Replies

8. Shell Programming and Scripting

Rename specific file extension in directory with match to another file in bash

I have a specific set (all ending with .bam) of downloaded files in a directory /home/cmccabe/Desktop/NGS/API/2-15-2016. What I am trying to do is use a match to $2 in name to rename the downloaded files. To make things a more involved the date of the folder is unique and in the header of name... (1 Reply)
Discussion started by: cmccabe
1 Replies

9. Shell Programming and Scripting

awk to update file based on partial match in field1 and exact match in field2

I am trying to create a cronjob that will run on startup that will look at a list.txt file to see if there is a later version of a database using database.txt as the source. The matching lines are written to output. $1 in database.txt will be in list.txt as a partial match. $2 of database.txt... (2 Replies)
Discussion started by: cmccabe
2 Replies

10. Shell Programming and Scripting

Search file containing ps results for a match "my.cnf" and then for a second match . "ok:" and

I need to find two matches in the output from ps. I am searching with ps -ef |grep mysql for: my.cnf /bin/sh /usr/bin/mysqld_safe --defaults-file=/data/mysql/master/agis_core/etc/my.cnf after this match I want to search back and match the hostname which is x number of lines back, above the... (2 Replies)
Discussion started by: bash_in_my_head
2 Replies
XMLCATALOG(1)							 xmlcatalog Manual						     XMLCATALOG(1)

NAME
xmlcatalog - Command line tool to parse and manipulate XML or SGML catalog files. SYNOPSIS
xmlcatalog [--sgml | --shell | --create | --del VALUE(S) | [ --add TYPE ORIG REPLACE | --add FILENAME] | --noout | --no-super-update | [-v | --verbose]] {CATALOGFILE} {ENTITIES...} DESCRIPTION
xmlcatalog is a command line application allowing users to monitor and manipulate XML and SGML catalogs. It is included in libxml(3). Its functions can be invoked from a single command from the command line, or it can perform multiple functions in interactive mode. It can operate on both XML and SGML files. OPTIONS
xmlcatalog accepts the following options (in alphabetical order): --add TYPE ORIG REPLACE Add an entry to CATALOGFILE. TYPE indicates the type of entry. Possible types are: public, system, uri, rewriteSystem, rewriteURI, delegatePublic, delegateSystem, delegateURI, nextCatalog. ORIG is the original reference to be replaced, and REPLACE is the URI of the replacement entity to be used. The --add option will not overwrite CATALOGFILE, outputting to stdout, unless --noout is used. The --add will always take three parameters even if some of the XML catalog constructs will have only a single argument. --add FILENAME If the --add option is used following the --sgml option, only a single argument, a FILENAME, is used. This is used to add the name of a catalog file to an SGML supercatalog, a file that contains references to other included SGML catalog files. --create Create a new XML catalog. Outputs to stdout, ignoring filename unless --noout is used, in which case it creates a new catalog file filename. --del VALUE(S) Remove entries from CATALOGFILE matching VALUE(S). The --del option will not overwrite CATALOGFILE, outputting to stdout, unless --noout is used. --noout Save output to the named file rather than outputting to stdout. --no-super-update Do not update the SGML super catalog. --shell Run a shell allowing interactive queries on catalog file CATALOGFILE. For the set of available commands see the section called "SHELL COMMANDS". --sgml Uses SGML super catalogs for --add and --del options. -v, --verbose Output debugging information. SHELL COMMANDS
Invoking xmlcatalog with the --shell CATALOGFILE option opens a command line shell allowing interactive access to the catalog file identified by CATALOGFILE. Invoking the shell provides a command line prompt after which the following commands (described in alphabetical order) can be entered. add TYPE ORIG REPLACE Add an entry to the catalog file. TYPE indicates the type of entry. Possible types are: public, system, uri, rewriteSystem, rewriteURI, delegatePublic, delegateSystem, delegateURI, nextCatalog. ORIG is the original reference to be replaced, and REPLACE is the URI of the replacement entity to be used. The --add option will not overwrite CATALOGFILE, outputting to stdout, unless --noout is used. The --add will always take three parameters even if some of the XML catalog constructs will have only a single argument. debug Print debugging statements showing the steps xmlcatalog is executing. del VALUE(S) Remove the catalog entry corresponding to VALUE(S). dump Print the current catalog. exit Quit the shell. public PUBLIC-ID Execute a Formal Public Identifier look-up of the catalog entry for PUBLIC-ID. The corresponding entry will be output to the command line. quiet Stop printing debugging statements. system SYSTEM-ID Execute a Formal Public Identifier look-up of the catalog entry for SYSTEM-ID. The corresponding entry will be output to the command line. ENVIRONMENT
XML_CATALOG_FILES XML catalog behavior can be changed by redirecting queries to the user's own set of catalogs. This can be done by setting the XML_CATALOG_FILES environment variable to a list of catalogs. An empty one should deactivate loading the default /etc/xml/catalog catalog. DIAGNOSTICS
xmlcatalog return codes provide information that can be used when calling it from scripts. 0 No error 1 Failed to remove an entry from the catalog 2 Failed to save to the catalog, check file permissions 3 Failed to add an entry to the catalog 4 Failed to look up an entry in the catalog SEE ALSO
libxml(3) More information can be found at o libxml(3) web page http://www.xmlsoft.org/ o libxml(3) catalog support web page at http://www.xmlsoft.org/catalog.html o James Clark's SGML catalog page http://www.jclark.com/sp/catalog.htm o OASIS XML catalog specification http://www.oasis-open.org/committees/entity/spec.html AUTHOR
John Fleck <jfleck@inkstain.net> Author. COPYRIGHT
Copyright (C) 2001, 2004 libxml2 $Date$ XMLCATALOG(1)
All times are GMT -4. The time now is 10:18 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy