Sponsored Content
Top Forums Shell Programming and Scripting How to create a file using awk Post 302413977 by durden_tyler on Sunday 18th of April 2010 11:55:12 PM
Old 04-19-2010
Quote:
Originally Posted by beatblaster666
Hm this one creates a file under target but it's name is filename and not what the string variable filename is equal to. Any idea?
Seems like I misread your first post:

Quote:
...what i need to do is create (inside the awk program) a file called 'filename' under the target.
...
Anyway, try this -

Code:
system ("touch "target"/"filename)

which should create a file with the name that equals the value of the variable "filename", in the directory with the name that equals the value of the variable "target".

tyler_durden
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Read a file and search a value in another file create third file using AWK

Hi, I have two files with the format shown below. I need to read first field(value before comma) from file 1 and search for a record in file 2 that has the same value in the field "KEY=" and write the complete record of file 2 with corresponding field 2 of the first file in to result file. ... (11 Replies)
Discussion started by: King Kalyan
11 Replies

2. Shell Programming and Scripting

Select some lines from a txt file and create a new file with awk

Hi there, I have a text file with several colums separated by "|;#" I need to search the file extracting all columns starting with the value of "1" or "2" saving in a separate file just the first 7 columns of each row maching the criteria, with replacement of the saparators in the nearly created... (4 Replies)
Discussion started by: capnino
4 Replies

3. Shell Programming and Scripting

generating a create ddl from a csv file using awk

Hello, I would greatly appreciate some help on the this I have comma delimited file as follows: csv file -------- TEST1,fld1,VARCHAR2,3,,, TEST1,fld2,DATE,,,, TEST1,fld2,VARCHAR2,51,,, TEST1,fld4,VARCHAR2,2,,, TEST1,fld5,NUMBER,4,0,, TEST1,fld6,VARCHAR2,1,,,... (5 Replies)
Discussion started by: jville
5 Replies

4. Shell Programming and Scripting

Create ranges on a file with awk

Hello all, Let's say we have this file : $ cat inputfile 2 3 4 7 8 11 15 16 17 I'm trying to make a script with awk which gives as output the following : (4 Replies)
Discussion started by: rany1
4 Replies

5. Shell Programming and Scripting

Using awk to create a summary of a structured file

I am trying to use awk to create a summary of a structured file. Here is what it looks like: (random text) H1 H2 H3 H4 44 78 99 30 31 -- 32 21 12 33 55 21 I'd like to be able to specify a column, say H2, and then have information about that column printed. ... (4 Replies)
Discussion started by: afulldevnull
4 Replies

6. Shell Programming and Scripting

Awk: from two file create a mail with attached error

Hi. My name is Mirko I have two file. File 1: mio@mio.it tst@test.com bye@bye.fr File 2: error 08 ffff mio@mio.it test error 05 ffff bye@bye.fr test error 11 ffff tst@test.com test error 65 ffff mio@mio.it test error 55 ffff bye@bye.fr test Examples I would like to send a mail... (2 Replies)
Discussion started by: Gionfalco01
2 Replies

7. Shell Programming and Scripting

awk parsing file to create a database

Hi Guys, I have a list a hotels stored in many different text files. This list is kept in the following format: 20/03 Hotel: The Bear Hotel Honey Street Woodstock UK Tel:+44-xxxxxx Rate: 100 21/03 Hotel: The Bush Hotel Nice Street Farnham (4 Replies)
Discussion started by: freddie50
4 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

Splitting a text file into smaller files with awk, how to create a different name for each new file

Hello, I have some large text files that look like, putrescine Mrv1583 01041713302D 6 5 0 0 0 0 999 V2000 2.0928 -0.2063 0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0 5.6650 0.2063 0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0 3.5217 ... (3 Replies)
Discussion started by: LMHmedchem
3 Replies

10. UNIX for Beginners Questions & Answers

awk and sed script to create one output CSV file

Hi All , I would require your help to generate one output file after post processing of one CSV file as stated below This file is just a small cut from a big file . Big file is having 20000 lines PATTERN,pat0,pat1,pat2,pat3,pat4,pat5,pat6,pat7,pat8,pat9... (2 Replies)
Discussion started by: kshitij
2 Replies
mailp(1)							   User Commands							  mailp(1)

NAME
mailp, digestp, filep, newsp, filofaxp, franklinp, timemanp, timesysp - frontends to the mp Text to PDL (Printer Description Language) pretty print filter SYNOPSIS
mailp [options] filename... newsp [options] filename... digestp [options] filename... filep [options] filename... filofaxp [options] filename... franklinp [options] filename... timemanp [options] filename... timesysp [options] filename... DESCRIPTION
The mailp utility is a frontend to the mp(1) program. It uses different names to provide various mp options: mailp Prints out mail messages. newsp Prints out USENET news articles. digestp Prints out USENET digest files. filep Prints out ordinary ASCII files. filofaxp Prints out in Filofax personal organiser format. franklinp Prints out in Franklin Planner personal organiser format. timemanp Prints out in Time Manager personal organiser format. timesysp Prints out in Time/System International personal organiser format. mailp and the associated programs read each filename in sequence and generate a prettified version of the contents. If no filename argu- ments are provided, mailp reads the standard input. mailp works in two ways. With the -D option, it will work as an X print server client to produce the PDL of the target printer and spool it. With the -d or -P option, it will generate and spool PostScripttm output. OPTIONS
The following options are supported: -d printer Sends output to the named printer. Otherwise, sends output to the printer named in the PRINTER environment variable. -D Generates the PDL for the target printer and spools it to the printer. -F Instead of printing who the mail article is for, the top header will contain who the mail article is from. This is a useful option for people with their own personal printer. -h Banner printing is disabled. Most of the information that typically appears on the banner sheet is output in the mp ban- ners. -l Formats output in landscape mode. Two pages of text will be printed per sheet of paper. -P printer Same as -d option. -s subject Uses subject as the new subject for the printout. If you are printing ordinary ASCII files which have been specified on the command line, the subject will default to the name of each of these files. OPERANDS
The following operand is supported: filename The name of the file to be read. ENVIRONMENT VARIABLES
If none of the -d, -D, or -P options is used, mailp uses the PRINTER environment variable to determine the printer to which the output from the mp(1)program is sent. If the PRINTER variable is not found, the default destination is the PostScripttm printer. EXIT STATUS
The following exit values are returned: 0 Successful completion. 1 An error occurred. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWmp | +-----------------------------+-----------------------------+ SEE ALSO
mp(1), attributes(5) NOTES
The -P option, which spools the PDL directly to the target printer in mp(1), produces PostScripttm when used in mailp so as to be backward compatible. SunOS 5.10 30 Oct 2000 mailp(1)
All times are GMT -4. The time now is 12:02 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy