UNIX script to append multiple text files into one file based on pattern present in filaname
Hi All-I am new to Unix , I need to write a script. Can someone help me with a requirement where I have list of files in a directory, I want to Merge the files if a pattern of string matches in filenames?
If second part of filename='555A' and third part consists of ORANGE then all Oranges/555A content files will merger into one file with filename as AAAl_555A_ORANGE.txt.
If second part of filename='555B' and third part consists of ORANGE/555B then all Oranges content files will merger into one file with filename as AAAl_555B_ORANGE.txt.
If second part of filename='555A' and third part consists of MANGO then all Mango content files will merger into one file with filename as AAAl_555A_MANGO.txt, etc.
Kindly help ..!
Last edited by Shankar455; 05-09-2019 at 12:23 PM..
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)
I have a text file with a list of items/patterns:
ConsensusfromCGX_alldays_trimmedcollapsedfilteredreadscontiglist(229095contigs)contig12238
ConsensusfromCGX_alldays_trimmedcollapsedfilteredreadscontiglist(229095contigs)contig34624... (1 Reply)
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)
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)
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)
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)
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)
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)
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
LEARN ABOUT OPENSOLARIS
txtrecordgetitematindex
TXTRecordCreate(3DNS_SD) DNS Service Discovery Library Functions TXTRecordCreate(3DNS_SD)NAME
TXTRecordCreate, TXTRecordDeallocate, TXTRecordSetValue, TXTRecordRemoveValue, TXTRecordGetLength, TXTRecordGetBytesPtr, TXTRecordCon-
tainsKey, TXTRecordGetValuePtr, TXTRecordGetCount, TXTRecordGetItemAtIndex - DNS TXT record manipulation functions
SYNOPSIS
cc [ flag ... ] file ... -ldns_sd [ library ... ]
#include <dns_sd.h>
void TXTRecordCreate(TXTRecordRef *txtRecord, uint16_t bufferLen,
void *buffer);
void TXTRecordDeallocate(TXTRecordRef*txtRecord);
DNSServiceErrorType txtRecord(TXTRecordRef *txtRecord,
const char *key, uint8_t valueSize, const void *value);
DNSServiceErrorType TXTRecordRemoveValue(TXTRecordRef *txtRecord,
const char *key);
uint16_t TXTRecordGetLength(const TXTRecordRef *txtRecord);
const void *TXTRecordGetBytesPtr(const TXTRecordRef *txtRecord);
int *TXTRecordContainsKey(uint16_t *txtLen,
const void *txtRecord, const char *key);
const void *TXTRecordGetValuePtr(uint16_t *txtLen,
const void *txtRecord, const char *key,
uint8_t *valueLen);
uint16_t *TXTRecordGetCount(uint16_t *txtLen,
const void *txtRecord);
DNSServiceErrorType TXTRecordGetItemAtIndex(uint16_t *txtLen,
const void *txtRecord, uint16_t *index,
uint16_t *keyBufLen, char *key,
uint8_t *valueLen, const void **value);
DESCRIPTION
These functions in the libdns_sd library allow applications to create and to manipulate TXT resource records. TXT resource records enable
applications to include service specific information, other than a host name and port number, as part of the service registration.
ATTRIBUTES
See attributes(5) for description of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Interface Stability |Committed |
+-----------------------------+-----------------------------+
|MT-Level |Safe |
+-----------------------------+-----------------------------+
SEE ALSO attributes(5)SunOS 5.11 20 Aug 2007 TXTRecordCreate(3DNS_SD)