Hi All,
Please help me out with a script which checks whether a given file say abc.txt is in ASCII format and data is tab-delimited. If the condition doesn't satisfy then it should generate error code "100" for file not in ASCII format and "105" if it is not in tab-delimited format.
If the... (9 Replies)
I have a text file that made using text editor in Ubuntu. However the text file is not being recognized as space or tab delimited, the formatting seems to be messed up. How can I convert the text file into tab delimited format? (3 Replies)
I have a file having the following entries:
test1 test2 test3
11 22 33
22 44 66
99 99 44
---
I want to add a column so that the above file becomes:
test1 test2 test3 notest
11 22 33 *
22 44 66 *
99 99 44 *
---
Thanks (6 Replies)
Hi Forum
I have a tab delimited file that opens well in Openoffice calc (excel). But when I perform any operation in command line, it reads the file incorrectly. When I 'save As' the same file in office as tab delimited then it works fine.
The file that I think is tab delimited is actually... (8 Replies)
Dear All,
I would like to find an automatic way to add a given code which belong to a class at the end of the column , for example this is my input file:
0610009O20Rik
V$VMYB_01 310 (+) 1 0.971 v-Myb
V$EVI1_04 782 (-) 0.763 0.834 Evi-1
V$ELK1_02 1966 (-) 1 0.984 Elk-1... (4 Replies)
Hi, I have a rquirement in unix as below .
I have a text file with me seperated by | symbol and i need to generate a excel file through unix commands/script so that each value will go to each column.
ex:
Input Text file:
1|A|apple
2|B|bottle
excel file to be generated as output as... (9 Replies)
Input file:
xyz,pqrs.lmno,NA,NA,NA,NA,NA,NA,NA
abcd,pqrs.xyz,NA,NA,NA,NA,NA,NA,NA
Expected Output:
xyz pqrs.lmno NA NA NA NA NA NA NA
abcd pqrs.xyz NA NA NA NA NA NA NA
Command Tried so far:
awk -F"," 'BEGIN{OFS=" ";} {print}' $File_Path/File_Name.csv
Issue:... (5 Replies)
Since output of w command have variable number of columns I want to get the output in pipe delimited format. I tried
export OFS="|"; w
but that does not work.
Any ideas? (4 Replies)
Perl::Critic::Policy::ValuesAndExpressions::ProhibitCommUseraContriPerl::Critic::Policy::ValuesAndExpressions::ProhibitCommaSeparatedStatements(3)NAME
Perl::Critic::Policy::ValuesAndExpressions::ProhibitCommaSeparatedStatements - Don't use the comma operator as a statement separator.
AFFILIATION
This Policy is part of the core Perl::Critic distribution.
DESCRIPTION
Perl's comma statement separator has really low precedence, which leads to code that looks like it's using the comma list element separator
not actually doing so. Conway suggests that the statement separator not be used in order to prevent this situation.
The confusion that the statement separator causes is primarily due to the assignment operators having higher precedence.
For example, trying to combine two arrays into another like this won't work:
@x = @y, @z;
because it is equivalent to
@x = @y;
@z;
Conversely, there are the built-in functions, like "print", that normally force the rest of the statement into list context, but don't when
called like a subroutine.
This is not likely to produce what is intended:
print join q{, }, 2, 3, 5, 7, ": the single-digit primes.
";
The obvious fix is to add parentheses. Placing them like
print join( q{, }, 2, 3, 5, 7 ), ": the single-digit primes.
";
will work, but
print ( join q{, }, 2, 3, 5, 7 ), ": the single-digit primes.
";
will not, because it is equivalent to
print( join q{, }, 2, 3, 5, 7 );
": the single-digit primes.
";
CONFIGURATION
This policy can be configured to allow the last statement in a "map" or "grep" block to be comma separated. This is done via the
"allow_last_statement_to_be_comma_separated_in_map_and_grep" option like so:
[ValuesAndExpressions::ProhibitCommaSeparatedStatements]
allow_last_statement_to_be_comma_separated_in_map_and_grep = 1
With this option off (the default), the following code violates this policy.
%hash = map {$_, 1} @list;
With this option on, this statement is allowed. Even if this option is off, using a fat comma "=>" works, but that forces stringification
on the first value, which may not be what you want.
BUGS
Needs to check for "scalar( something, something )".
AUTHOR
Elliot Shank "<perl@galumph.com>"
COPYRIGHT
Copyright (c) 2007-2011 Elliot Shank.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. The full text of this license
can be found in the LICENSE file included with this module.
perl v5.16.3Perl::Critic::Policy::ValuesAndExpressions::ProhibitCommaSeparatedStatements(3)