Sponsored Content
Top Forums UNIX for Beginners Questions & Answers UNIX script to append multiple text files into one file based on pattern present in filaname Post 303034927 by RudiC on Thursday 9th of May 2019 11:26:29 AM
Old 05-09-2019
Please answer Peasant's question.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Split a file into multiple files based on the input pattern

I have a file with lines something like. ...... 123_start ...... ....... 123_end .... ..... 456_start ...... ..... 456_end .... ..... 789_start .... .... 789_end (6 Replies)
Discussion started by: abinash
6 Replies

2. Shell Programming and Scripting

Splitting large file into multiple files in unix based on pattern

I need to write a shell script for below scenario My input file has data in format: qwerty0101TWE 12345 01022005 01022005 datainala alanfernanded 26 qwerty0101mXZ 12349 01022005 06022008 datainalb johngalilo 28 qwerty0101TWE 12342 01022005 07022009 datainalc hitalbert 43 qwerty0101CFG 12345... (19 Replies)
Discussion started by: jimmy12
19 Replies

3. UNIX for Dummies Questions & Answers

print multiple lines from text file based on pattern list

I have a text file with a list of items/patterns: ConsensusfromCGX_alldays_trimmedcollapsedfilteredreadscontiglist(229095contigs)contig12238 ConsensusfromCGX_alldays_trimmedcollapsedfilteredreadscontiglist(229095contigs)contig34624... (1 Reply)
Discussion started by: Oyster
1 Replies

4. Shell Programming and Scripting

split XML file into multiple files based on pattern

Hello, I am using awk to split a file into multiple files using command: nawk '{ if ( $1 == "<process" ) { n=split($2, arr, "\""); file=arr } print > file }' processes.xml <process name="Process1.process"> ... (3 Replies)
Discussion started by: chiru_h
3 Replies

5. UNIX for Dummies Questions & Answers

Append text to files with a same pattern

Hi Folks, I wanted to know if i can use RegEx in a for-loop of a shell script. Here's a scenario, I have a set of files say x1, x2, x3..x9 in a directory(obviously with files other than this pattern). I want to append a line of text to all files that follow pattern x. Can someone help me out? I... (4 Replies)
Discussion started by: prithvirao17
4 Replies

6. Shell Programming and Scripting

Use sed to append text to filenames if text not already present

I have some html with hrefs that contain local links to pdf filenames. These filenames should have standardised names, i.e. there should be a label prior to the ".pdf" filename suffix. There can be many of these links on a single line of text and some may already have the label. For example ... (13 Replies)
Discussion started by: adb
13 Replies

7. Shell Programming and Scripting

Help with ksh-to read ip file & append lines to another file based on pattern match

Hi, I need help with this- input.txt : L B white X Y white A B brown M Y black Read this input file and if 3rd column is "white", then add specific lines to another file insert.txt. If 3rd column is brown, add different set of lines to insert.txt, and so on. For example, the given... (6 Replies)
Discussion started by: prashob123
6 Replies

8. Shell Programming and Scripting

Split a text file into multiple pages based on pattern

Hi, I have a text file (attached the sample). I have also, attached the way the way the files need to be split. We get this file, that will either have 24 Jurisdictions, or will miss some and retain some. Like in the attached sample file, there are only Jurisdictions 03,11,14,15, 20 and 30.... (3 Replies)
Discussion started by: ebsus
3 Replies

9. UNIX for Advanced & Expert Users

Concatenation of multiple files based on file pattern

Hi, I have the following reports that get generated every 1 hour and this is my requirement: 1. 5 reports get generated every hour with the names "Report.Dddmmyy.Thhmiss.CTLR" "Report.Dddmmyy.Thhmiss.ACCD" "Report.Dddmmyy.Thhmiss.BCCD" "Report.Dddmmyy.Thhmiss.CCCD"... (1 Reply)
Discussion started by: Jesshelle David
1 Replies

10. UNIX for Beginners Questions & Answers

UNIX script to replace old date with current date dynamically in multiple files present in a folder

I am trying to work on a script where it is a *(star) delimited file has a multiple lines starts with RTG and 3rd column=TD8 I want to substring the date part and I want to replace with currentdate minus 15 days. Here is an example. iam using AIX server $ cat temp.txt RTG*888*TD8*20180201~... (1 Reply)
Discussion started by: Shankar455
1 Replies
Prophet::CLI::Command(3pm)				User Contributed Perl Documentation				Prophet::CLI::Command(3pm)

   Registering argument translations
       This is the Prophet CLI's way of supporting short forms for arguments, e.g. you want to let '-v' be able to used for the same purpose as
       '--verbose' without dirtying your code checking both or manually setting them if they exist. We want it to be as easy as possible to have
       short commands.

       To use, have your command subclass do:

	   sub ARG_TRANSLATIONS { shift->SUPER::ARG_TRANSLATIONS(),  f => 'file' };

       You can register as many translations at a time as you want.  The arguments will be translated when the command object is instantiated. If
       an arg already exists in the arg translation table, it is overwritten with the new value.

   require_uuid
       Checks to make sure the uuid attribute is set. Prints an error and dies with the command's usage string if it is not set.

   edit_text [text] -> text
       Filters the given text through the user's $EDITOR using Proc::InvokeEditor.

   edit_hash hash => hashref, ordering => arrayref
       Filters the hash through the user's $EDITOR using Proc::InvokeEditor.

       No validation is done on the input or output.

       If the optional ordering argument is specified, hash keys will be presented in that order (with unspecified elements following) for edit.

       If the record class for the current type defines a "immutable_props" routine, those props will not be presented for editing.

       False values are not returned unless a prop is removed from the output.

   edit_props arg => str, defaults => hashref, ordering => arrayref
       Returns a hashref of the command's props mixed in with any default props.  If the "arg" argument is specified, (default "edit", use "undef"
       if you only want default arguments), then "edit_hash" is invoked on the property list.

       If the "ordering" argument is specified, properties will be presented in that order (with unspecified props following) if filtered through
       "edit_hash".

   prompt_choices question
       Asks user the question and returns 0 if answer was the second choice, 1 otherwise. (First choice is the default.)

   prompt_Yn question
       Asks user the question and returns true if answer was positive or false otherwise. Default answer is 'Yes' (returns true).

   print_usage
       Print the command's usage message to STDERR and die. Commands should implement "usage_msg", which returns the usage message.

       If the usage message method needs arguments passed in, use a closure.

   get_cmd_and_subcmd_names [no_type => 1]
       Gets the name of the script that was run and the primary commands that were specified on the command-line. If a true boolean is passed in
       as "no_type", won't add '<record-type>' to the subcmd if no type was passed in via the primary commands.

perl v5.10.1							    2009-08-19						Prophet::CLI::Command(3pm)
All times are GMT -4. The time now is 05:26 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy