10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I am just trying to output the below awk separated by tabs. Thank you :).
awk (added OFS as an attempt to itroduce tabs)
awk '{split($5,a,"-"); OFS='\t' print $1,$2,$3,a}' file.bed > test.bed
The awk runs and produces all the data in 1 field instead of 4 fields.
current output
... (2 Replies)
Discussion started by: cmccabe
2 Replies
2. Shell Programming and Scripting
Hi All,
I have an awk command that uses the substr function - At the moment I know the length of the values so can use the example below i.e substr(i,0,1)
However in future these lengths may change so wondered if you can use a delimiter within a substr? Like in bash you could use cut -d ';',... (6 Replies)
Discussion started by: Ads89
6 Replies
3. Shell Programming and Scripting
I've a pipe delimited data in a file of size 3GB. if the text data conatins pipe delimiter that will be enclose with double quotes. I have to replace delimiter which exists between double quotes with #%@#%@#%@ using awk or sed. can some one provide a better and efficient solution to me.
The below... (4 Replies)
Discussion started by: BrahmaNaiduA
4 Replies
4. Shell Programming and Scripting
I have file like below
abc 12 34 45 code
abcdef 451 1 4 code
ghtyggg 4 56 3 code
I need to change this to
abc|12|34|45|code|
abcdef|451|1|4|code|
ghtyggg|4|56|3|code|
I tried replace space with | in sed ... but in the middle some row has... (7 Replies)
Discussion started by: greenworld123
7 Replies
5. Shell Programming and Scripting
Hi Friends,
I have a file1.txt as below
29123973Ç2012-0529Ç35310124Ç000000000004762Ç00010Ç20Ç390ÇÇÇÇF
29123974Ç20120529Ç35310125Ç0000000000046770Ç00010Ç20Ç390ÇÇÇÇF
29123975Ç20120529Ç35310126Ç0000000000046804Ç00010Ç20Ç390ÇÇÇÇF
29123976Ç20120529Ç35310127Ç0000000000044820Ç00010Ç20Ç390ÇÇÇÇF
i have a file2.txt... (4 Replies)
Discussion started by: i150371485
4 Replies
6. Shell Programming and Scripting
Hi all,
Currently i am using
if( $0~/ NOT / && $0~/ NULL /)
{
.................
}
to check if the input record contains "NOT" and "NULL". But in some cases "NOT" and "NULL" are preceded and followed by tab. How do i find compare for these fields as well? (3 Replies)
Discussion started by: ysvsr1
3 Replies
7. Shell Programming and Scripting
I have a file containing about 5 million rows, in the file there are some records which has extra delimiter at random position. (we dont know the positions), now we have to Count the delimeter from each row and if the count of delimeter is not matching then I want to delete those rows from the... (5 Replies)
Discussion started by: Akumar1
5 Replies
8. Shell Programming and Scripting
HI,
Need awk command to get date and time alone from
Input : "15:29:15 28.08.2010|SCHEDULE: Started program POSG1"
Output expected : "15:29:15 28.08.2010"
Please help. (9 Replies)
Discussion started by: shanneykar
9 Replies
9. Shell Programming and Scripting
Dear All,
Good Day. I would like to hear your suggestions for the following problem:
I have a file with 5 columns with some numbers in 16 lines as shown below.
Input file:
Col 1 Col 2 Col 3 Col 4 Col 5
12 220 2 121 20
234 30 22 9... (3 Replies)
Discussion started by: Fredrick
3 Replies
10. Shell Programming and Scripting
Wants to print line when there exist leading or trailing space or tab in fields 2,3 and 5
The below code prints all lines in file even if they dont have leading and trailing space or tab.
nawk -F"|" '{for(i=1;i<=NF;i++) {if ($i ~ "^*" || $i ~ "*$")}}1' file
file
Ouput required:
... (5 Replies)
Discussion started by: pinnacle
5 Replies
utf8trans(1) docbook2X utf8trans(1)
NAME
utf8trans - Transliterate UTF-8 characters according to a table
SYNOPSIS
utf8trans charmap [file]...
DESCRIPTION
utf8trans transliterates characters in the specified files (or standard input, if they are not specified) and writes the output to standard
output. All input and output is in the UTF-8 encoding.
This program is usually used to render characters in Unicode text files as some markup escapes or ASCII transliterations. (It is not in-
tended for general charset conversions.) It provides functionality similar to the character maps in XSLT 2.0 (XML Stylesheet Language -
Transformations, version 2.0).
OPTIONS
-m, --modify
Modifies the given files in-place with their transliterated output, instead of sending it to standard output.
This option is useful for efficient transliteration of many files at once.
--help Show brief usage information and exit.
--version
Show version and exit.
USAGE
The translation is done according to the rules in the 'character map', named in the file charmap. It has the following format:
1. Each line represents a translation entry, except for blank lines and comment lines, which are ignored.
2. Any amount of whitespace (space or tab) may precede the start of an entry.
3. Comment lines begin with #. Everything on the same line is ignored.
4. Each entry consists of the Unicode codepoint of the character to translate, in hexadecimal, followed one space or tab, followed by the
translation string, up to the end of the line.
5. The translation string is taken literally, including any leading and trailing spaces (except the delimeter between the codepoint and
the translation string), and all types of characters. The newline at the end is not included.
The above format is intended to be restrictive, to keep utf8trans simple. But if a XML-based format is desired, there is a
xmlcharmap2utf8trans script that comes with the docbook2X distribution, that converts character maps in XSLT 2.0 format to the utf8trans
format.
LIMITATIONS
o utf8trans does not work with binary files, because malformed UTF-8 sequences in the input are substituted with U+FFFD characters. Howev-
er, null characters in the input are handled correctly. This limitation may be removed in the future.
o There is no way to include a newline or null in the substitution string.
AUTHOR
Steve Cheng <stevecheng@users.sourceforge.net>.
docbook2X 0.8.8 3 March 2007 utf8trans(1)