Sponsored Content
Top Forums UNIX for Dummies Questions & Answers awk - Rename output file, after processing, same as input file Post 302933642 by Scrutinizer on Sunday 1st of February 2015 02:23:15 AM
Old 02-01-2015
So it is just
Code:
mv DEF.txt ABC.txt

that is giving you trouble?

In post #1 you mentioned an error. What is the exact error message..
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Writing output into different files while processing file using AWK

Hi, I am trying to do the following using AWK program. 1. Read the input data file 2. Parse the record and see if it contains errors 3. If the record contains errors, then write it into Reject file, else, write into usual output file or display it on the screen Here is what I have done -... (6 Replies)
Discussion started by: vidyak
6 Replies

2. Shell Programming and Scripting

awk should output if one input file doesnt have matching key

nawk -F, 'FNR==NR{a= $3 ;next} $2 in a{print $1, 'Person',$2, a}' OFS=, filea fileb Input filea Input fileb output i am getting : (2 Replies)
Discussion started by: pinnacle
2 Replies

3. Shell Programming and Scripting

Pass input and output file as parameter to awk script

Hi, i am new to awk. I am using csv2pipe script(shown below) BEGIN { FS=SUBSEP; OFS="|" } { result = setcsv($0, ",") print } # setcsv(str, sep) - parse CSV (MS specification) input # str, the string to be parsed. (Most likely $0.) # sep, the separator between the values. # #... (6 Replies)
Discussion started by: bhaskarjha178
6 Replies

4. Shell Programming and Scripting

Dynamic output file generation using a input text file with predefined output format

Hi, I have two files , one file with data file with attributes that need to be sent to another file to generate a predefined format. Example: File.txt AP|{SSHA}VEEg42CNCghUnGhCVg== APVG3|{SSHA}XK|"password" AP3|{SSHA}XK|"This is test" .... etc --------- test.sh has... (1 Reply)
Discussion started by: hudson03051nh
1 Replies

5. Shell Programming and Scripting

AWK Script to convert input file(s) to output file

Hi All, I am hoping someone can help me with some scripting I need to complete using AWK. I'm trying to process multiple fixed files to generate one concatenated fixed file in a standard format. The Input file is:- aaaa bbbbb ccccc 1 xxxx aaa bbb aaaa bbbbb ccccc 2 abcd aaa CCC... (9 Replies)
Discussion started by: jason_v_brown
9 Replies

6. Shell Programming and Scripting

processing an input file and then the output file

Hi. I am new to scripting and could really do with some advice on the best way to put a script together. Here is the scenario I am working to; - i will get files via ftp to a tmp directory on the server - all files will have a unique file name but with the same extension (.USM) - for each... (5 Replies)
Discussion started by: yabai
5 Replies

7. Shell Programming and Scripting

Recursive file processing from a path and printing output in a file

Hi All, The script below read the path and searches for the directories/subdirectories and for the files. If files are found in the sub directories then read the content of the all files and put the content in csv(comma delimted) format and the call the write to xml function to write the std... (1 Reply)
Discussion started by: Optimus81
1 Replies

8. Programming

awk processing / Shell Script Processing to remove columns text file

Hello, I extracted a list of files in a directory with the command ls . However this is not my computer, so the ls functionality has been revamped so that it gives the filesizes in front like this : This is the output of ls command : I stored the output in a file filelist 1.1M... (5 Replies)
Discussion started by: ajayram
5 Replies

9. UNIX for Dummies Questions & Answers

Redirect output to the same input file in awk

Hi, I want to compare a value from test file and redirect the o/p value to the same file input file 250 32000 32 128 Below is my code awk '{ if ($1 < "300") print $1 > /tmp/test}' test want to compare 250 < 300 then print 300 to the same place below is the... (24 Replies)
Discussion started by: stew
24 Replies

10. Shell Programming and Scripting

awk to reformat output if input file is empty, but not if file has data in it

The below awk improved bu @MadeInGermany, works great as long as the input file has data in it in the below format: input chrX 25031028 25031925 chrX:25031028-25031925 ARX 631 18 chrX 25031028 25031925 chrX:25031028-25031925 ARX 632 14... (3 Replies)
Discussion started by: cmccabe
3 Replies
ABCMATCH(1)						      General Commands Manual						       ABCMATCH(1)

NAME
abcmatch - search sequences of notes in an ABC file SYNOPSIS
abcmatch data-file [number] [-a] [-br d] [-c] [-con] [-ign] [-length_hist] [-pitch_hist] [-qnt] [-r n] [-v] [-ver] DESCRIPTION
abcmatch searches an ABC file containing (potentially) many tunes for specific sequences of notes. For example, if you know a few bars of a tune, you can use this program to find the tune having this sequence and perhaps identify the tune. At a minimum, abcmatch requires two files. A template file called match.abc which contains the bars that you are searching for and a large file consisting of a hundred or more ABC tunes. The program automatically loads up the match.abc file and then scans every tune in the large file. Though the program can be run stand-alone, it is really meant to be run with a GUI such as runabc.tcl (which is not yet part of Debian). Most of its output is rather cryptic. THE MATCHING PROCESS
The template file must be a well-formed ABC file containing the basic X:, M:, L:, and K: headers as well as the bars to be matched. (Nor- mally, this file is created by runabc.tcl.) It is important to finish each bar in the match file with a vertical line. abcmatch uses the key signature to figure out the relative position of the notes in the scale, and to determine all the assumed sharps and flats. Therefore the program can find matching bars in a tune that has been transposed to another key, as long as the key difference is not too large. Matches are output in a list format looking like 29 30 4 30 31 4 Each line indicates a particular match found by the program. The first number on each line gives the relative position of the tune in the data-file, while the next number gives the X: number of that tune. The last number is the bar number of the matching tune. Bar numbers are counted sequentially from the start of the tune, and all V: and P: indications are ignored. That is, the bar number returned by abcmatch may not match bar numbers printed by one of the PostScript-producing ABC processors such as abcm2ps or abcmidi-yaps. For the purposes of matching, abcmatch ignores all guitar chords, lyrics, note decorations (e.g., staccato markings), grace notes, etc. In chords such as [G2c2], only the highest note is considered. Any warnings or error messages from the ABC parser are suppressed unless the -c option is given. OPTIONS
-a Report any matching bars. By default, if the template file contains a sequence of several bars, the program will try to find places in the data file where the whole sequence matches. With this option, it returns all places in the data file where any of the bars in the template file match. -br d `Brief mode' is designed to identify groups of tunes sharing common bars. In this mode, the program determines the number of all bars in each tune from the data file which are also present in the template file. If the number of common bars is greater than or equal to the value of the d parameter, the program reports the tune and the number of common bars. Currently there is no user con- trol of the matching criterion; the rhythm must match exactly, and the notes are transposed to suit the key signature. -c Display error and warning messages from the ABC parser (which are suppressed by default). -con Do a pitch contour match. In this case, the program uses the key signature only to indicate accidentals. The pitch contour is com- puted from the pitch difference (interval) between adjacent notes. That is, C2 DE, c2 de, and G2 AB all have the same pitch contour. -ign Ignore simple bars. -length_hist This does no matching at all but returns a histogram of the distribution of note lengths in the data file. The output looks like length histogram 12 100 24 20 36 6 48 2 72 4 where a quarter note is 24 units, an eight note 12 units, a dotted half note 72 units etc. -pitch_hist This does no matching at all but returns a histogram of the distribution of pitches in the data file. The output looks like pitch histogram 64 2 66 9 67 11 where the first number on each line is a MIDI note number and the second is a count of the number of times that note occurred. -qnt Do a quantized pitch contour match. This works as described above for the -con option, but will also quantize the intervals as fol- lows: Unison and semitone intervals are assigned value 0, major 2nds to major 3rds value 1, and a perfect 4th or greater value 2. Negative numbers are used for descending intervals. -r n Resolution for matching. If the n parameter is zero, a perfect match must be found, meaning that the lengths of each note in a bar must match exactly in order to be reported. The larger the value of n, the looser the match will be. Note lengths are converted into temporal units where a quarter note is normally assigned a value of 24 (therefore an eighth note has a value of 12, a sixteenth a value of 6, a half note a value of 48 etc.) If you specify a temporal resolution of 12, then the pitch values of the notes only need to match at the time units that are multiples of an eight note. This means that the program would match the two bars C2 D2 and C C D D, as well as C2 D2 and C/D/C/D/D2. By selecting a suitable value for n, you can search for matches only at the beginning of a mea- sure or at the beginning of each beat. -v Run verbosely. -ver Display the program's version number. LIMITATIONS
The program has some limitations. For example, the data file must contain bar lines, and tied notes cannot be longer than the equivalent of 8 quarter notes. A resolution (-r option) that is too small may cause some buffers to be exceeded. When there are differences of key signa- tures of more than 5 semitones, the program may transpose the notes in the wrong direction. Also, tunes with more than one key signature or time signature may not be processed correctly. SEE ALSO
abc2midi(1), midi2abc(1), mftext(1) AUTHOR
This manual page was written by Anselm Lingnau <lingnau@debian.org> for the GNU/Linux system. VERSION
This manual page describes abcmatch version 1.42 as of 21 December 2006. 24 August 2007 ABCMATCH(1)
All times are GMT -4. The time now is 06:13 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy