Sponsored Content
Top Forums Shell Programming and Scripting awk separate files to one directory Post 302957542 by Don Cragun on Monday 12th of October 2015 02:51:58 PM
Old 10-12-2015
Thanks RudiC. Yes, it should have been:
Code:
srcdir="$PWD"
cd /home/cmccabe/Desktop/panels/BMF
awk -F '[ :]' '
{f = $3 ".txt"
 print > f
 close(f)
}' "$srcdir"/BMF_unix_loop_genes_IonXpress_008_150902_loop_genes_average_IonXpress_008_150902.bed

 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Using Awk within awk to read all files in directory

I am wondering if anyone has any idea how to use an awk within awk to read files and find a match which adds to count. Say I am searching how many times the word crap appears in each files within a directory. How would i do that from the command prompt ... thanks (6 Replies)
Discussion started by: flevongo
6 Replies

2. Shell Programming and Scripting

Using AWK to separate data from a large XML file into multiple files

I have a 500 MB XML file from a FileMaker database export, it's formatted horribly (no line breaks at all). The node structure is basically <FMPXMLRESULT> <METADATA> <FIELD att="............." id="..."/> </METADATA> <RESULTSET FOUND="1763457"> <ROW att="....." etc="...."> ... (16 Replies)
Discussion started by: JRy
16 Replies

3. Shell Programming and Scripting

Concatenating lines of separate files using awk or sed

For example: File 1: abc def ghi jkl mno pqr File 2: stu vwx yza bcd efg hij klm nop qrs I want the reult to be: abc def ghistu vwx yza jkl mno pqrbcd efg hij klm nop qrs (4 Replies)
Discussion started by: tamahomekarasu
4 Replies

4. Shell Programming and Scripting

handling multiple files using awk command and wants to get separate out file for each

hai all I am new to the world of shell scripting I wanted to extract two columns from multiple files say around 25 files and i wanted to get the separate outfile for each input file tired using the following command to extract two columns from 25 files awk... (2 Replies)
Discussion started by: hema dhevi
2 Replies

5. Shell Programming and Scripting

Apply 'awk' to all files in a directory or individual files from a command line

Hi All, I am using the awk command to replace ',' by '\t' (tabs) in a csv file. I would like to apply this to all .csv files in a directory and create .txt files with the tabs. How would I do this in a script? I have the following script called "csvtabs": awk 'BEGIN { FS... (4 Replies)
Discussion started by: ScKaSx
4 Replies

6. UNIX for Dummies Questions & Answers

awk to match multiple regex and create separate output files

Howdy Folks, I have a list that looks like this: (file2.txt) AAA BBB CCC DDD and there are 24 of these short words. I am matching these patterns to another file with 755795 lines (file1.txt). I have this code for matching: awk -v f2=file2.txt ' BEGIN { while(... (2 Replies)
Discussion started by: heecha
2 Replies

7. Shell Programming and Scripting

awk command to compare a file with set of files in a directory using 'awk'

Hi, I have a situation to compare one file, say file1.txt with a set of files in directory.The directory contains more than 100 files. To be more precise, the requirement is to compare the first field of file1.txt with the first field in all the files in the directory.The files in the... (10 Replies)
Discussion started by: anandek
10 Replies

8. Programming

GFORTRAN sending .o files in separate directory

I am using gfortran and want to send .o files in separate directory. Currently I have the following in a bash script. The .mod files are handled ok, but the .o files are still created in the same directory as the source code fsrc="newunit.f08 math.f08 tString.f08 prout.f08 prary.f08... (1 Reply)
Discussion started by: kristinu
1 Replies

9. Shell Programming and Scripting

awk to create separate files but not include specific field in output

I am trying to use awk to create (in this example) 3 seperate text file from the unique id in $1 in file, if it starts with the pattern aa. The contents of each row is used to populate each text file except for $1 which is not needed. It seems I am close but not quite get there. Thank you :). ... (3 Replies)
Discussion started by: cmccabe
3 Replies

10. UNIX for Beginners Questions & Answers

Awk: output lines with common field to separate files

Hi, A beginner one. my input.tab (tab-separated): h1 h2 h3 h4 h5 item1 grpA 2 3 customer1 item2 grpB 4 6 customer1 item3 grpA 5 9 customer1 item4 grpA 0 0 customer2 item5 grpA 9 1 customer2 objective: output a file for each customer ($5) with the item number ($1) only if $2 matches... (2 Replies)
Discussion started by: beca123456
2 Replies
MAKEKDEDOC(1)						     KDOC Documentation System						     MAKEKDEDOC(1)

NAME
makekdedoc -- Generates HTML documentation for KDE libraries using KDOC. SYNOPSIS
makekdedoc [--rule-file=<rulefile>] [--libdir=<libdir>] [--outputdir=<outputdir>] [--url=<url>] [--srcdir=<kdelibs src dir>] [--kdoc=<path to kdoc>] [<library>...] makekdedoc --help DESCRIPTION
This is a perl script that uses KDOC to generate documentation for kdelibs. A "rule" file is used to figure out the libraries to document, the order in which to document them and the libraries with which each one will be cross-referenced (eg kdeui uses -lkdecore). See "FILES" for more info. NOTE: The script assumes that you have already generated a Qt cross-reference using qt2kdoc[1]. OPTIONS
Defaults for each option are in square brackets. library... Specify the libraries to document. By default, all libraries defined by the rule file are documented. --outputdir <path>, -d <path> The directory where the output will be written. [`cwd`/srcdoc] --url <url>, -u <url> The base URL by which the generated docs will be accessed. For example, if your web server is configured to use $HOME/public_html for your home page, you could set the outputdir to $HOME/public_html/srcdoc and the url to http://myhost/~mylogin/srcdoc. [output dir] --rule-file <path>, -r <path> The path to the rule file to use for generating the documentation. [<srcdir>/kdoc.rules] --libdir <path>, -L <path> The directory in which the KDOC cross-reference files are stored. [$KDOCLIBS if set, otherwise $HOME/.kdoc] --kdoc <path>, -k <path> The path to the kdoc program. [kdoc] --kdocopt <options>, -p <options> Extra options to be passed to kdoc. --srcdir <path>, -b <path> The path to the kdelibs source, eg "$HOME/baseline/kdelibs". [`cwd`] --help, -h Quit with a usage message. EXAMPLES
makekdedoc --srcdir $HOME/baseline/kdelibs --outputdir $HOME/public_html/src/kdelibs/ --url "http://www.ph.unimelb.edu.au/~ssk/src/kdelibs" FILES
Rule file This file lists the directories in the source directory to document. It also lists the files to document from each directory, and the libraries with which to cross-reference the generated documentation. Here is a small example that documents two libraries and links the second to the first. # makekdedoc rule file doc_MODULES = eenie meenie # rules for eenie eenie_FILES = *.h eenie_LIBS = -lqt # rules for meenie meenie_FILES = a.h b.h meenie_LIBS = -leenie -lqt In this example, all files in "eenie/*.h" will be documented then two files from "meenie/" will be documented, in the order declared in "doc_MODULES". SEE ALSO
See kdoc[1] and qt2kdoc[1]. VERSION
makekdedoc $Revision: 1.2 $ AUTHOR
The script and this documentation were written by Sirtaj Singh Kang <taj@kde.org> in April 1999. 2.0a54 2000-10-10 MAKEKDEDOC(1)
All times are GMT -4. The time now is 08:27 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy