Sponsored Content
Top Forums Shell Programming and Scripting awk to extract digit in line of text and create link Post 302984645 by vgersh99 on Friday 28th of October 2016 01:48:06 PM
Old 10-28-2016
Code:
awk -F'/' '
{
  n=split($6,a,"_")
  pdf=a[n]+0
  print $1"//"$3 "/report/latex/" pdf ".pdf"
}' myFile

This User Gave Thanks to vgersh99 For This Post:
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Extract pattern from text line

Gents, from these sample lines: ZUCR.MI ZUCCHI SPA RISP NC 2,5000 6 ott 0,0000 ZV.MI ZIGNAGO VETRO 3,6475 16:36 Up 0,0075 is it possible to get this: ZUCR.MI 2,5000 ZV.MI 3,6475 i.e. the first field, a separator and the first decimal number? (in Europe we... (9 Replies)
Discussion started by: vampirodolce
9 Replies

2. Shell Programming and Scripting

Extract pattern from text line

Hi, the text line looks like this: "test1" " " "test2" "test3" "test4" "10" "test 10 12" "00:05:58" "filename.bin" "3.3MB" "/dir/name" "18459" what's the best way to select any of it? So I can for example get only the time or size and so on. I was trying awk -F""" '{print $N}' but... (3 Replies)
Discussion started by: TehOne
3 Replies

3. UNIX for Dummies Questions & Answers

How to extract text from a line in file

I have a file abc.txt as below : <dbport oa_var="s_dbport" oa_type="EXT_PORT" base="1521" step="1" range="-1" label="Database Port">1616</dbport> <rpc_port oa_var="s_rpcport" oa_type="PORT" base="1626" step="1" range="-1" label="RPC Port">1721</rpc_port> <web_ssl_port oa_var="s_webssl_port"... (7 Replies)
Discussion started by: findprakash
7 Replies

4. Shell Programming and Scripting

Extract pattern from text line

The text line has the following formats: what.ever.bla.bla.C01G06.BLA.BLA2 what.ever.bla.bla.C11G33.BLA.BLA2 what.ever.bla.bla.01x03.BLA.BLA2 what.ever.bla.bla.03x05.BLA.BLA2 what.ever.bla.bla.Part01.BLA.BLA2 and other similar ones, I need a way to select the "what.ever.bla.bla" part out... (4 Replies)
Discussion started by: TehOne
4 Replies

5. Shell Programming and Scripting

get the fifth line of a text file into a shell script and trim the line to extract a WORD

FOLKS , i have a text file that is generated automatically of an another korn shell script, i want to bring in the fifth line of the text file in to my korn shell script and look for a particular word in the line . Can you all share some thoughts on this one. thanks... Venu (3 Replies)
Discussion started by: venu
3 Replies

6. Shell Programming and Scripting

awk length of digit and print at most right digit

Have columns with digits and strings like: input.txt 3840 3841 3842 Dav Thun Tax Cahn 146; Dav. 3855 3853 3861 3862 Dav Thun Tax 2780 Karl VI., 3873 3872 3872 Dav Thun Tax 3894 3893 3897 3899 Dav Thun Tax 403; Thun 282. 3958 3959 3960 Dav Thun Tax 3972 3972 3972 3975 Dav Thun Tax... (8 Replies)
Discussion started by: sdf
8 Replies

7. Shell Programming and Scripting

Extract 4 digit characters

* hdisk99 U5791.001.9920BZ4-P1-C05-T1-W500507630E060C14-L401140BA00000000 IBM MPIO FC 1750 * hdisk100 U5791.001.9920BZ4-P1-C05-T1-W500507630E060C14-L401140BB00000000 IBM MPIO FC 1750 * hdisk185 U5791.001.9920BZ4-P1-C05-T1-W500507630E060C14-L401140A000000000 IBM MPIO FC... (2 Replies)
Discussion started by: Daniel Gate
2 Replies

8. Shell Programming and Scripting

awk to create variables to pass into a bash loop to create a download link

I have created one file that contains all the necessary info in it to create a download link. In each of the lines /results/analysis/output/Home/Auto_user_S5-00580-6-Medexome_67_032/plugin_out/FileExporter_out.67... (8 Replies)
Discussion started by: cmccabe
8 Replies

9. Shell Programming and Scripting

awk to remove lines that do not start with digit and combine line or lines

I have been searching and trying to come up with an awk that will perform the following on a converted text file (original is a pdf). 1. Since the first two lines are (begin with) text they are removed 2. if $1 is a number then all text is merged (combined) into one line until the next... (3 Replies)
Discussion started by: cmccabe
3 Replies

10. Shell Programming and Scripting

awk to create link, download, and extract in sub-directory

The awk below will create sub-directories in a directory (which is always the last line of file1, each block separated by an empty line), if the number in line 2 (always the first 6 digits in the format xx-xxxx) of file2 is found in $2 of file1. This is the current awk output. If there is a... (0 Replies)
Discussion started by: cmccabe
0 Replies
LATEXDIFF-VC(1) 					User Contributed Perl Documentation					   LATEXDIFF-VC(1)

NAME
latexdiff-vc - wrapper script that calls latexdiff for different versions of a file under version management (CVS, RCS or SVN) SYNOPSIS
latexdiff-vc [ latexdiff-options ] [ latexdiff-vc-options ] -r [rev1] [-r rev2] file1.tex [ file2.tex ...] or latexdiff-vc [ latexdiff-options ] [ latexdiff-vc-options ][ --postscript | --pdf ] old.tex new.tex DESCRIPTION
latexdiff-vc is a wrapper script that applies latexdiff to a file, or multiple files under version control (CVS or RCS), and optionally runs the sequence of "latex" and "dvips" or "pdflatex" commands necessary to produce pdf or postscript output of the difference tex file(s). It can also be applied to a pair of files to automatise the generation of difference file in postscript or pdf format. OPTIONS
--rcs, --svn, or --cvs Set the version system. If no version system is specified, latexdiff-vc will venture a guess. latexdiff-cvs and latexdiff-rcs are variants of latexdiff-vc which default to the respective versioning system. However, this default can still be overridden using the options above. -r, -r rev or --revision, --revision=rev Choose revision (under RCS, CVS or SVN). One or two -r options can be specified, and the resulting in different behaviour: latexdiff-vc -r file.tex ... compares file.tex with the most recent version checked into RCS. latexdiff-vc -r rev1 file.tex ... compares file.tex with revision rev1. latexdiff-vc -r rev1 -r rev2 file.tex ... compares revisions rev1 and rev2 of file.tex. Multiple files can be specified for all of the above options. All files must have the extension ".tex", though. latexdiff-vc old.tex new.tex compares two files. The name of the difference file is generated automatically and reported to stdout. -d or --dir -d path or --dir=path Rather than appending the string "diff" and optionally the version numbers given to the output-file, this will prepend a directory name "diff" to the original filename, creating the directory and subdirectories should they not exist already. This is particularly useful in order to clone a complete directory hierarchy. Optionally, a pathname path can be specified, which is prepended instead of "diff". --ps or --postscript Generate postscript output from difference file. This will run the sequence "latex; latex; dvips" on the difference file (do not use this option in the rare cases, where three "latex" commands are required if you care about correct referencing). If the difference file contains a "ibliography" tag, run the sequence "latex; bibtex; latex; latex; dvips". --pdf Generate pdf output from difference file using "pdflatex". This will run the sequence "pdflatex; pdflatex" on the difference file, or "pdflatex; bibtex; pdflatex; pdflatex" for files requiring bibtex. --force Overwrite existing diff files without asking for confirmation. Default behaviour is to ask for confirmation before overwriting an existing difference file. --help or -h Show help text --version Show version number All other options are passed on to "latexdiff". SEE ALSO
latexdiff PORTABILITY
latexdiff-vc uses external commands and is therefore limited to Unix-like systems. It also requires the RCS version control system and latex to be installed on the system. Modules from Perl 5.8 or higher are required. AUTHOR
Copyright (C) 2005 Frederik Tilmann This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License Version 2 Contributors: S Utcke, H Bruyninckx perl v5.14.2 2007-09-29 LATEXDIFF-VC(1)
All times are GMT -4. The time now is 03:27 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy