04-12-2019
Dear Singh,
I am not getting output.
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi,
I need to paste each 10 lines of single column to several columns.
Please, can anyone tell me how to write in awk?
Input File:
22
34
36
12
17
19
15
11
89
99
56
38
29 (4 Replies)
Discussion started by: nica
4 Replies
2. Shell Programming and Scripting
Please help me. This is simple, but urgent problem for me. :(
I have a two files
file1
1 2 3 4 5 6
1 2 3 4 5 6
1 2 3 4 5 6
.....
file2
11 12 13 14 15
11 12 13 14 15
11 12 13 14 15
.....
1) I hope to make a new file, file 3, that consists of 2nd... (2 Replies)
Discussion started by: exsonic
2 Replies
3. UNIX for Advanced & Expert Users
Hi All,
I have a fixedwidth file of length 3000. Now i want to copy a column of 4 chars i.e( length 1678-1681) to column 1127 – 1171 to the same file.
Please let me know how can i achive using a single command in fixed width file.
Also source column length is 4 chars and target column length... (4 Replies)
Discussion started by: kiranparsha
4 Replies
4. UNIX for Dummies Questions & Answers
Any shortcuts for doing this? I need to cut the column 4 values from File1 and paste them as column4 values of File2, but only for the (first) same number of lines as File1 . All rows in File1 are contained in File2 in the exact same order, so the cut paste should work.
File1 (with header and 3... (4 Replies)
Discussion started by: senhia83
4 Replies
5. Shell Programming and Scripting
Hello, I have a script extracting columns of useful numbers from a data file, and manipulating the numbers with awk commands. I have problems with my script...
1. There are two lines assigning numbers to $BaseForAveraging. If I use the commented line (the first one) and let the second one... (9 Replies)
Discussion started by: vgbraymond
9 Replies
6. Shell Programming and Scripting
Hi all,
I've multiple files. In this case 5. Space separated columns. Each file has 12 columns. Each file has 300-400K lines.
I want to get the output such that if a value in column 2 is present in all the files then get all the columns of that value and print it side by side.
Desired output... (15 Replies)
Discussion started by: genome
15 Replies
7. Shell Programming and Scripting
#cat data.txt
file1 folder1
file2 thisforfile2
file3 thisfolderforfile3
lata4 folder4
step 1: create the folder first in column 2
for i in `awk '{print $2}' data.txt`
do
mkdir /home/data/$i
done
step 2: locate the files in column1 and stored them into a file
for i in... (17 Replies)
Discussion started by: kenshinhimura
17 Replies
8. UNIX for Beginners Questions & Answers
Source Code of the original script is down below please run the script and try to solve this problem
this is my data and I want it column wise
2019-03-20 13:00:00:000
2019-03-20 15:00:00:000
1
Operating System
LAB
0
1
1
1
1
1
1
1
1
1
0
1 (5 Replies)
Discussion started by: Shubham1182
5 Replies
9. UNIX for Beginners Questions & Answers
Dear all
I have a multiple directories, say for example org1, org2, org3 ..... org100 and each directory having a file namely dnaG.fasta. I need to copy all the dnaG.fasta file from each directory and paste in another directory fastconcatg. Therefore, my script has to copy dnaG.fasta file from... (5 Replies)
Discussion started by: dineshkumarsrk
5 Replies
10. UNIX for Beginners Questions & Answers
I have number of csv files (like tmo_2019*). In these files some files have 5th column value as V. I want to copy those files having 5th column value as V to specific directory /test/V_files/.
I tried to extract file names by below but not able to complete command for copy.
find -type f -iname... (4 Replies)
Discussion started by: Bops
4 Replies
LEARN ABOUT DEBIAN
class::makemethods::utility::textbuilder
MakeMethods::Utility::TextBuilder(3pm) User Contributed Perl Documentation MakeMethods::Utility::TextBuilder(3pm)
NAME
Class::MakeMethods::Utility::TextBuilder - Basic text substitutions
SYNOPSIS
print text_builder( $base_text, @exprs )
DESCRIPTION
This module provides a single function, which implements a simple "text macro" mechanism for assembling templated text strings.
$expanded_text = text_builder( $base_text, @exprs )
Returns a modified copy of $base_text using rules from the @exprs list.
The @exprs list may contain any of the following:
o A string, in which any '*' characters will be replaced by the base text. The interpolated string then replaces the base text.
o A code-ref, which will be called with the base text as its only argument. The result of that call then replaces the base text.
o A hash-ref, which will be added to the substitution hash used in the second pass, below.
o An array-ref, containing additional expressions to be treated as above.
After any initial string and code-ref rules have been applied, the hash of substitution rules are applied.
The text will be searched for occurances of the keys of the substitution hash, which will be modified based on the corresponding value in
the hash. If the substitution key ends with '{}', the search will also match a balanced block of braces, and that value will also be used
in the substitution.
The hash-ref may contain the following types of rules:
o 'string' => 'string'
Occurances of the first string are to be replaced by the second.
o 'string' => code_ref
Occurances of the string are to be replaced by the results of calling the subroutine with no arguments.
o 'string{}' => 'string'
Occurances of the first string and subsequent block of braces are replaced by a copy of the second string in which any '*' characters
have first been replaced by the contents of the brace block.
o 'string{}' => code_ref
Occurances of the string and subsequent block of braces are replaced by the results of calling the subroutine with the contents of the
brace block as its only argument.
o 'string{}' => hash_ref
Occurances of the string and subsequent block of braces are replaced by using the contents of the brace block as a key into the
provided hash-ref.
EXAMPLE
The following text and modification rules provides a skeleton for a collection letter:
my $letter = "You owe us AMOUNT. Please pay up!
" .
"THREAT{SEVERITY}";
my @exprs = (
"Dear NAMEm
*",
"*
-- The Management",
{ 'THREAT{}' => { 'good'=>'Please?', 'bad'=>'Or else!' } },
" DATE
*",
{ 'DATE' => 'Tuesday, April 1, 2001' },
);
One might invoke this template by providing additional data for a given instance and calling the text_builder function:
my $item = { 'NAME'=>'John', 'AMOUNT'=>'200 camels', 'SEVERITY'=>'bad' };
print text_builder( $letter, @exprs, $item );
The resulting output is shown below:
Tuesday, April 1, 2001
Dear John,
You owe us 200 camels. Please pay up!
Or else!
-- The Management
SEE ALSO
See Class::MakeMethods for general information about this distribution.
perl v5.10.1 2004-09-06 MakeMethods::Utility::TextBuilder(3pm)