09-29-2017
Again, there are some bits missing, and both input (I understand the explicatory text, but the space remains) and desired output are different from post#1.
- Still, you didn't answer where the "Zzzz" comes from, and this can't be derived from your code. Is it a string constant?
- Is that file ALWAYS 7 lines, and the "rules" would be "bring line 7 to the top, adding a constant, then print lines 1 and 4, 2 & 5, and 3 & 6, each separated by comma and a space, but the trailing comma needs to be removed"?
- Do we need to check for text or numeric?
Last edited by RudiC; 09-29-2017 at 05:37 AM..
Reason: Misread the input file; reduced No. of lines to 7.
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi,
I want to write a shell script which increments a particular column in a row from a text file and then adds another row below the current row with the incremented value .
For Eg .
if the input file has a row :
abc xyz lmn 89 lm nk o p
I would like the script to create something like... (9 Replies)
Discussion started by: aYankeeFan
9 Replies
2. Shell Programming and Scripting
Hi Guys,
I have a file as follows:
a 1
b 786
c 90709
d 99
a 9875
b 989
c 887
d 111
I want:
a 1 9875
b 786 989 (3 Replies)
Discussion started by: npatwardhan
3 Replies
3. Shell Programming and Scripting
Dear friends,
Below is my program and current output. I wish to have 3 or 4 column output in order to accomodate in single page. i do have subsequent command to process after user enter the number.
Program
COUNT=1
for MYDIR in `ls /`
do
VOBS=${MYDIR}
echo "${COUNT}. ${MYDIR}"
... (4 Replies)
Discussion started by: baluchen
4 Replies
4. Shell Programming and Scripting
Hello,
I have an input file like the following:
11_3_4
2_1_35
3_15__
_16989
Where '_' is a space. The data is in a table. Is there a way for the program to prompt the user for x1,y1 and x2,y2, where x1,y1 is the desired number (for example x=6 y=4 is a value of 4) and move to a desired spot... (2 Replies)
Discussion started by: jl487
2 Replies
5. UNIX for Dummies Questions & Answers
How do you delete cells from a space delimited text file given row and column number? Letś say the row number is r and the column number is c. Thanks! (5 Replies)
Discussion started by: evelibertine
5 Replies
6. Shell Programming and Scripting
cat file1.txt
field1 "user1":
field2:"data-cde"
field3:"data-pqr"
field4:"data-mno"
field1 "user1":
field2:"data-dcb"
field3:"data-mxz"
field4:"data-zul"
field1 "user2":
field2:"data-cqz"
field3:"data-xoq"
field4:"data-pos"
Now i need to have the date like below.
i have just... (7 Replies)
Discussion started by: ckaramsetty
7 Replies
7. UNIX for Advanced & Expert Users
Hi,
I want to convert a 3-column data to 3-row data using shell script. Any suggestion in this regard is highly appreciated.
Thanks. (4 Replies)
Discussion started by: sktkpl
4 Replies
8. UNIX for Dummies Questions & Answers
Hi,
I would like to add a new column containing the row numbers to a text file. How do I go about doing that? Thanks!
Example input:
A X
B Y
C D
Output:
A X 1
B Y 2
C D 3 (5 Replies)
Discussion started by: evelibertine
5 Replies
9. UNIX for Dummies Questions & Answers
file with this content
awk 'NR==1 {print $4} && NR==2 {print $5}' file
The error is shown with syntax error; what can be done (4 Replies)
Discussion started by: cdfd123
4 Replies
10. Shell Programming and Scripting
Hi,
I have a comma separated file. I would like to print every alternate columns into a new row.
Example input file:
Name : John, Age : 30, DOB : 30-Oct-2018
Example output:
Name,Age,DOB
John,30,30-Oct-2018 (3 Replies)
Discussion started by: Lini
3 Replies
LEARN ABOUT DEBIAN
utf8trans
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)