Sponsored Content
Top Forums Shell Programming and Scripting Filename from splitting files to have the same filename of the original file with counter value Post 302370994 by Franklin52 on Friday 13th of November 2009 05:15:38 AM
Old 11-13-2009
With awk:

Code:
awk -F"[-.]" '{for(i=0;i<5;i++)print $0 "_output" i}' file

 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Moving files by splitting the path embedded in the filename

Hello All. I am having a directory /tmp/rahul which contains many files in the format @#home@#rahul@#programs@#script.pl where /home/rahul/programs is the directory where the script.pl file is to be placed. I have many files in this format. What i want is a script which read these... (7 Replies)
Discussion started by: rahulrathod
7 Replies

2. Shell Programming and Scripting

gzcat into awk and then change FILENAME and process new FILENAME

I am trying to write a script that prompts users for date and time, then process the gzip file into awk. During the ksh part of the script another file is created and needs to be processed with a different set of pattern matches then I need to combine the two in the end. I'm stuck at the part... (6 Replies)
Discussion started by: timj123
6 Replies

3. UNIX for Dummies Questions & Answers

Replace all files with a certain filename with another file

I tried searching for this, but I might have used the wrong terms as I couldn't find answers to this question. I'm looking for a way to replace all files with a certain filename with another file within a specific directory including all of it's subdirectory using a shell-script. (2 Replies)
Discussion started by: Schmellsera
2 Replies

4. Shell Programming and Scripting

joining multiple files into one while putting the filename in the file

Hello, I know how to join multiple files using the cat function. I want to do something a little more advanced. Basically I want to put the filename in the first column... One thing to note is that the file is tab delimited. e.g. file1.txt joe 1 4 5 6 7 3 manny 2 3 4 5 6 7 ... (4 Replies)
Discussion started by: phil_heath
4 Replies

5. Shell Programming and Scripting

Merge CSV files and create a column with the filename from the original file

Hello everyone!! I am not completely new to shell script but I havent been able to find the answer to my problem and I'm sure there are some smart brains here up for the challenge :D. I have several CSV files that I need to combine into one, but I also need to know where each row came from.... (7 Replies)
Discussion started by: fransanchezoria
7 Replies

6. UNIX for Dummies Questions & Answers

to extract all the part of the filename before a particular word in the filename

Hi All, Thanks in Advance I am working on a shell script. I need some assistance. My Requirement: 1) There are some set of files in a directory like given below OTP_UFSC_20120530000000_acc.csv OTP_UFSC_20120530000000_faf.csv OTP_UFSC_20120530000000_prom.csv... (0 Replies)
Discussion started by: aealexanderraj
0 Replies

7. Programming

to extract all the part of the filename before a particular word in the filename

Hi All, Thanks in Advance I am working on a shell script. I need some assistance. My code: if then set "subscriber" "promplan" "mapping" "dedicatedaccount" "faflistSub" "faflistAcc" "accumulator"\ "pam_account"; for i in 1 2 3 4 5 6 7 8;... (0 Replies)
Discussion started by: aealexanderraj
0 Replies

8. Shell Programming and Scripting

Non trivial file splitting, saving with variable filename

Hello, Although I have found similar questions, I could not find advice that could help with our problem. The issue: We have a few thousands text files (books). Each book has many chapters. Each chapter is identified by a cite-key. We need to split each of those book files by... (4 Replies)
Discussion started by: samask
4 Replies

9. Open Source

Splitting files using awk and reading filename value from input data

I have a process that requires me to read data from huge log files and find the most recent entry on a per-user basis. The number of users may fluctuate wildly month to month, so I can't code for it with names or a set number of variables to capture the data, and the files are large so I don't... (7 Replies)
Discussion started by: rbatte1
7 Replies

10. UNIX for Beginners Questions & Answers

Renaming files by appending string from within file to filename

Greetings. I am working in a Linux environment and am trying to figure out a way to rename files in a directory by appending a unique strings that appears within a certain area in those files. I have gotten as far as identifying what that particular unique string is with a command like the... (10 Replies)
Discussion started by: HLee1981
10 Replies
TAP2JUNIT(1p)						User Contributed Perl Documentation					     TAP2JUNIT(1p)

NAME
tap2junit - Converts TAP output to JUnit SYNOPSIS
tap2junit [options] <filename> <filename> ... Options: --suffix <suffix> Suffix for JUnit output files (default ".xml") --verbose Display verbose status during conversion --name <name> Provide explicit name for the JUnit test --help/-? Display brief help message --man Display full documentation DESCRIPTION
"tap2junit" converts TAP output to JUnit. Give it a list of files containing TAP results and it will create a series of ????.junit.xml output files containing the JUnit representations of that TAP contained in the files. If you specify - as the filename, "tap2junit" will read from STDIN and write to STDOUT. You may also want to use the "--name" option to name the test explicitly (as the default name of "-" isn't going to make much sense). OPTIONS
--suffix <suffix> Specifies the suffix which is appended to all of the input files, in order to generate the filename for the JUnit XML file that is being output. If you want to live dangerously and over-write your original TAP files, you can set this to "" and your original TAP files will be over-written. Defaults to .xml --verbose Display verbose status information during the conversion (telling you which TAP file its working on). --name <name> Specifies an explicit name for the JUnit test. If no name is provided, a default name will be constructed based on the full path of the TAP file being processed. This option has also been aliased as "--junit_name" to provide compatibility with a patch from Joe McMahon. --help/-? Display brief help message. --man Displays the full documentation. AUTHOR
Graham TerMarsch <cpan@howlingfrog.com> COPYRIGHT
Copyright 2008-2010, Graham TerMarsch. All Rights Reserved. This is free software; you can redistribute it and/or modify it under the same terms as Perl itself. SEE ALSO
TAP::Formatter::JUnit. perl v5.14.2 2012-03-12 TAP2JUNIT(1p)
All times are GMT -4. The time now is 09:02 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy