Sponsored Content
Top Forums Shell Programming and Scripting Script to extract/compare from two files. Post 302883823 by Don Cragun on Thursday 16th of January 2014 08:35:13 AM
Old 01-16-2014
The output from RavinderSingh13's script doesn't come close to the requested output for either file, but the original post in this thread needs to give an English description of the processing used to produce the desired outputs from the given inputs. There is no explanation given that describes which lines are supposed to be copied, changed, or deleted in the output files???
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

script to compare files

HI i wil get input from sql query and that too i can get a list o f files or just one. i have to pick up a file from another directory which hads prefix to this prefix.x.x.x.x.x. And we have to discard prefix and use that file name. we have to compare this file name(no need... (0 Replies)
Discussion started by: pulse2india
0 Replies

2. Shell Programming and Scripting

Compare Records between to files and extract it

I am not an expert in awk, SED, etc... but I really hope there is a way to do this, because I don't want to have to right a program. I am using C shell. FILE 1 FILE 2 H0000000 H0000000 MA1 MA1 CA1DDDDDD CA1AAAAAA MA2 ... (2 Replies)
Discussion started by: jclanc8
2 Replies

3. Shell Programming and Scripting

compare 2 files and extract the data which is not present in other file with condition

I have 2 files whose data's are as follows : fileA 00 lieferungen 00 attractiop 01 done 02 forness 03 rasp 04 alwaysisng 04 funny 05 done1 fileB alwayssng dkhf fdgdfg dfgdg sdjkgkdfjg funny rasp (7 Replies)
Discussion started by: rajniman
7 Replies

4. Shell Programming and Scripting

need a shell script to extract the files from source file and check whether those files existonserve

Hi, I am new to shell scripting.Please help me on this.I am using solaris 10 OS and shell i am using is # echo $0 -sh My requirement is i have source file say makefile.I need to extract files with extensions (.c |.cxx |.h |.hxx |.sc) from the makefile.after doing so i need to check whether... (13 Replies)
Discussion started by: muraliinfy04
13 Replies

5. Shell Programming and Scripting

Compare multiple files, and extract items that are common to ALL files only

I have this code awk 'NR==FNR{a=$1;next} a' file1 file2 which does what I need it to do, but for only two files. I want to make it so that I can have multiple files (for example 30) and the code will return only the items that are in every single one of those files and ignore the ones... (7 Replies)
Discussion started by: castrojc
7 Replies

6. Shell Programming and Scripting

Compare files & extract column awk

I have two tab delimited files as given below: File_1: PV16 E1 865 2814 1950 PV16 E2 2756 3853 1098 PV16 E4 3333 3620 288 PV16 E5 3850 4101 252 PV16 E6 83 559 477 PV16 E7 562 858 297 PV16 L2 4237 5658 ... (10 Replies)
Discussion started by: vaibhavvsk
10 Replies

7. Shell Programming and Scripting

Compare 2 csv files by columns, then extract certain columns of matcing rows

Hi all, I'm pretty much a newbie to UNIX. I would appreciate any help with UNIX coding on comparing two large csv files (greater than 10 GB in size), and output a file with matching columns. I want to compare file1 and file2 by 'id' and 'chain' columns, then extract exact matching rows'... (5 Replies)
Discussion started by: bkane3
5 Replies

8. Shell Programming and Scripting

Compare two files and extract

Assume we have two files - FileA and FileB. Content of files are as shown below : FileA:1001,value1,value4,value8,value9 1002,value4,value32,value46,value33 1503,value5,value45,value68,value53 1605,value4,value67,value56,value57 1073,value5,value45,value68,value53... (3 Replies)
Discussion started by: alnhk
3 Replies

9. Shell Programming and Scripting

Compare two files and extract info

Hello, I have two files which look like this File 1 Name test1 status P Gene1 0.00236753 1 1.00E-01 Gene2 0.134187 2 2.00E-01 Gene3 0.000608716 2 3.00E-01 Gene4 0.0016234 1 4.00E-01 Gene5 0.000665868 2 5.00E-01and file 2 No Pos ... (2 Replies)
Discussion started by: nans
2 Replies

10. Shell Programming and Scripting

Compare 2 files and extract the data which is present in other file - awk is not working

file2 content f1file2 content f1,1,2,3,4,5 f1,2,4,6,8,10 f10,1,2,3,4,5 f10,2,4,6,8,10 f5,1,2,3,4,5 f5,2,4,6,8,10awk 'FNR==NR{a;next}; !($1 in a)' file2 file1output f10,1,2,3,4,5 f10,2,4,6,8,10 f5,1,2,3,4,5 f5,2,4,6,8,10awk 'FNR==NR{a;next}; ($1 in a)' file2 file1output nothing... (4 Replies)
Discussion started by: gksenthilkumar
4 Replies
XMLTO(1)							     Reference								  XMLTO(1)

NAME
xmlto - apply an XSL stylesheet to an XML document SYNOPSIS
xmlto [-o output_dir] [-x custom_xsl] [-m xsl_fragment] [-v] [-p postprocessor_opts] [--extensions] [--searchpath path] [--skip-validation] [--stringparam paramname=paramvalue] [--noclean] [--noautosize] [--with-fop] [--with-dblatex] {format} {file} xmlto {[--help] | [--version]} DESCRIPTION
The purpose of xmlto is to convert an XML file to the desired format using whatever means necessary. This may involve two steps: 1. The application of an appropriate XSL stylesheet using an XSL-T processor. 2. Further processing with other tools. This step may not be necessary. To decide which stylesheet to use and what, if any, needs to be done to post-process the output, xmlto makes use of format scripts, which are simple shell scripts that xmlto calls during the conversion. The appropriate format script is selected based on the type of XML file and the desired output format. xmlto comes with some format scripts for converting DocBook XML files to a variety of formats. You may specify your own format script by using an absolute filename for format on the command line. Firstly, if xmlto has not been told explicitly which stylesheet to use (with the -x option), the format script will be called with $1 set to stylesheet. The environment variable XSLT_PROCESSOR contains the base name of the executable that will be used to perform the XSL-T transformation (for example xsltproc). The format script should write the name of the stylesheet to use to standard output and exit successfully, or exit with a non-zero return code if there is no appropriate stylesheet to use (for example, if the only available stylesheet is known not to work with the XSL-T processor that will be used). If nothing is written to standard output but the script exits successfully, no XSL-T transformation will be performed. Secondly, after an XSL-T processor has been run using the stylesheet, the format script will be called again, this time with $1 set to post-process. The format script should perform any necessary steps to translate the XSL-T processed output into the desired output format, including copying the output to the desired output directory. For post-processing, the format script is run in a temporary directory containing just the processed output (whose name is stored in XSLT_PROCESSED and whose basename is that of the original XML file with any filename extension replaced with .proc). INPUT_FILE is set to the name of the original XML file, OUTPUT_DIR is set to the name of the directory that the output (and only the output) must end up in, and SEARCHPATH is set to a colon-separate list of fallback directories in which to look for input (for images, for example). If this step is unsuccessful the format script should exit with a non-zero return code. OPTIONS
-v Be verbose (-vv for very verbose). -x stylesheet Use stylesheet instead of asking the format script to choose one. -m fragment Use the provided XSL fragment to modify the stylesheet. -o directory Put output in the specified directory instead of the current working directory. -p postprocessor_opts Pass postprocessor_opts to processing stages after stylesheet application (e.g. lynx or links when going through HTML to text, or xmltex when going from through TeX to DVI). If -p is specified a second time, the options specified will be passed to second-stage postprocessing; presently this is only applicable when going through xmltex and dvips to PostScript. --extensions Turn on stylesheet extensions for the tool chain in use (for example, this might turn on passivetex.extensions and use.extensions if PassiveTeX is being used). The variables turned on are the ones used by Norman Walsh's DocBook XSL stylesheets. --searchpath path Add the colon-separated list of directories in path as fallback directories for including input. --skip-validation Skip the validation step that is normally performed. --stringparam paramname=paramvalue Pass a named parameter paramname with value paramvalue to stylesheet from the command line. --noclean Temporary files are not deleted(their names are shown and kept in tmp directory). It could help with analyzing problems. --noautosize By default, some XSL variables are overriden by autodetection (page.width and page.height for paperconf (libpaper) use, paper.type for locale-based (LC_PAPER) selection). With this option, xmlto doesn't use this autodetection and user is able to modify defaults himself (either via default param.xsl modification or by user-defined XSL fragment). --with-fop Use fop for formatting. It is an experimental option, expects fop in specific location(detected at configured time), could be changed manually in xmlto script by modification of FOP_PATH --with-dblatex Use dblatex for formatting. It is an experimental option, expects dblatex in specific location(detected at configured time), could be changed manually in xmlto script by modification of DBLATEX_PATH --help Display a short usage message. It will describe xmlto's options, and the available output formats. --version Display the version number of xmlto. ENVIRONMENT
XSLT_PROCESSOR Base name of the executable that will be used to perform the XSL-T transformation (default: xsltproc(1)). TMPDIR Directory, where to create temporary stylesheets (default: /tmp). DIAGNOSTICS
0 Everything went fine. This is the expected exit code. 1 xmlto was called with insufficient arguments. 2 mktemp(1) failed to create a file/directory. Make sure /tmp or TMPDIR is writable. 3 xmlto failed to find some binary on configured location. Make sure that all required packages are installed and paths in xmlto script are set properly. 10+(Validation non-zero error code) xmlto tried to validate a xml document, but validation failed. For better diagnostic, validation output and xmllint exit code is provided. Consider either fixing your document or using --skip-validation. EXAMPLES
To convert a DocBook XML document to PDF, use: xmlto pdf mydoc.xml To convert a DocBook XML document to HTML and store the resulting HTML files in a separate directory use: xmlto -o html-dir html mydoc.xml To convert a DocBook XML document to a single HTML file use: xmlto html-nochunks mydoc.xml To modify the output using an XSL fragment use: xmlto -m ulink.xsl pdf mydoc.xml To specify which stylesheet to use (overriding the one that the format script would choose) use: xmlto -x mystylesheet.xsl pdf mydoc.xml AUTHORS
Tim Waugh <twaugh@redhat.com> Original author, maintainer until 0.0.18 Ondej Vaik <ovasik@redhat.com> Maintainer since 0.0.19 COPYRIGHT
xmlto 0.0.23 September 2009 XMLTO(1)
All times are GMT -4. The time now is 02:36 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy