Im using awk and I want the output filename to contain the first field of the input file.
Ex.
1 dddd wwwww
1 eeeee wwww
1 wwww eerrrr
2 eeee eeeeee
I want the output files to be xxx1 and xxx2
Thank you (4 Replies)
I'm calling an embedded sql from my shell script file. This sql does simple task of spooling out the contents of the table (see below my sample code) into a spool file that I specify. So far so good, but the problem is that the output is also displayed on screen which I do NOT want.
How can I... (3 Replies)
Hi everybody,
I'm trying to replace the $98 field with "T" if the last field (108th) is T
I've tried
awk 'BEGIN{OFS=FS="|"} {if ($108=="T")sub($98,"T"); print}' test.txt
but that doesn't do anything
also tried
awk 'BEGIN{OFS=FS="|"}{ /*T.$/ sub($98,"T")} { print}' test.txt
but... (2 Replies)
Dear All,
1.txt (tab in between each value in a line)
a b c
a b c
a c d
you can see below, why with ~ i can output with tab, but = cannot?
# awk -F'\t' '$2 ~ /b/' 1
a b c
a b c
# awk -F'\t' '$2 = "b"' 1
a b c
a b c
a b d
... (1 Reply)
It seems like a common task, but I haven't been able to find the solution.
vitallog.txt
1310,John,Hancock
13211,Steven,Mills
122,Jane,Doe
138,Thoms,Doe
1500,Micheal,May
vitalinfo.txt
12122,Jane,Thomas
122,Janes,Does
123,Paul,Kite
**OUTPUT**
vitalfiltered.txt
12122,Jane,Thomas... (2 Replies)
In awk, how do I print all fields with a specified output field separator?
I have tried the following, which does not print the output FS:
echo a b c d | awk 'BEGIN{OFS = ";"}{print $0}' (3 Replies)
Hello,
I'm writing an Awk script to take a command line argument (student's name) and output their relevant student#, name, and marks. For some reason, awk arbitrarily removes the first digit from the student number and doesn't show me the proper output.
Here is my code:
#! /usr/bin/awk -f... (6 Replies)
The awk below is close but I can't seem to fix it to produce the desired output. Thank you :).
current awk with output
awk '{c1++; c2+=($2)}
END{for (e in c1) print e, c1, c2}' input
EFCAB5 2 50
USH2A 2 19
desired... (8 Replies)
The below awk uses $3 and $4 in search as the min and max, then takes each $2 value in lookup and compares it. If the value in lookupfalls within the range in searchthen it prints the entire line in lookup/ICODE]. What I can't seem to figure out is how to print the matching $5 from search on that... (4 Replies)
Hi Folks,
I have one requirement, There is one file, which contains two fields.
Based on first field, I need to print an output.
Example will be more suitable.
Input file like this.
abc 5
abc 10
xyz 6
xyz 9
xyz 10
mnp 10
mnp 12
mnp 6 (2 Replies)
Discussion started by: Raza Ali
2 Replies
LEARN ABOUT DEBIAN
ctie
CTIE(1) General Commands Manual CTIE(1)NAME
ctie - merge or apply CWEB change files
SYNOPSIS
ctie -c|-m outputfile masterfile changefile...
DESCRIPTION
The ctie program is used to process multiple change files used with the CWEB system for literate programming. The CWEB programs allow one
to apply patches to a source file (the masterfile) by means of a single change file. ctie can be used to either merge up to 32 change
files into a single one or to apply the changes to the masterfile in order to create a new master file. Output of either the new change
file or the patched master file goes into outputfile. Any include files (indicated using the CWEB @i command) are fully expanded during
ctie processing, which means that the change files are able to modify the contents of any included files.
OPTIONS -c Create a single change file from the given changefiles.
-m Create a new master file by applying the given changefiles.
ENVIRONMENT
The environment variable CWEBINPUTS is used to search for the input files, or the system default if CWEBINPUTS is not set. See tex(1) for
the details of the searching.
SEE ALSO cweb(1), ctiedoc.tex, tie(1), web(1).
AUTHOR
Julian Gilbey, jdg@debian.org. The original TIE program was by Klaus Guntermann, TH Darmstadt, Institut f. Theoretische Informatik. The
TIE man page was by Joachim Schnitter, TH Darmstadt, Phys. Chemie I, and was modified for CTIE by Julian Gilbey.
Web2C 2012 7 April 2010 CTIE(1)