10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi,
i was tried using the awk command for replacing '-' in the second column. but the below command replacing the entire file.
cat 1.txt |awk '{gsub(/-/,"")}1'
Input file
1,2,3,-4,5,6
1,-2,3,4,5,-6
1,2,3,4,5,6
1,-2,3,4,-5,6
Output file
1,2,3,-4,5,6
1,2,3,4,5,-6
1,2,3,4,5,6... (3 Replies)
Discussion started by: onesuri
3 Replies
2. Shell Programming and Scripting
Hello,
I'm strugling with some redirecting and all help is apreciated.
The following program is working as expected, but the result of the AT command doesn't go to any file.
Thanks in advance for the help.
#!/bin/bash
modem=/dev/ttyUSB1
file=/root/imsi.txt
# print error to stderr and exit... (4 Replies)
Discussion started by: cleitao
4 Replies
3. Shell Programming and Scripting
Hi,
Please help with this.
I have several excel files (with and .xlsx format) with 10-15 columns each.
They all have the same type of data but the columns are not ordered in the same way.
Here is a 3 column example. What I want to do add the alphabet
from column 2 to column 3, provided... (9 Replies)
Discussion started by: newbie83
9 Replies
4. Shell Programming and Scripting
Hello,
I have some tab delimited data and I need to move the last col. I could hard code it,
awk '{ print $1,$NF,$2,$3,$4,etc }' infile > outfile
but it would be nice to know the syntax to print a range cols.
I know in cut you can do,
cut -f 1,4-8,11-
to print fields 1,... (8 Replies)
Discussion started by: LMHmedchem
8 Replies
5. UNIX for Advanced & Expert Users
Hello everyone,
I am writing a script to process data from the ATP world tour.
I have a file which contains:
t=540 y=2011 r=1 p=N409
t=540 y=2011 r=2 p=N409
t=540 y=2011 r=3 p=N409
t=540 y=2011 r=4 p=N409
t=520 y=2011 r=1 p=N409
t=520 y=2011 r=2 p=N409
t=520 y=2011 r=3 p=N409
The... (4 Replies)
Discussion started by: imahmoud
4 Replies
6. Shell Programming and Scripting
can anyone help me in making singleline command for
Capital Letters are folders ,small letter are files
X,Y,Z are subfolders of A
as shown below
A - X,Y,Z
Folder X has three files a.txt,b.txt,c.txt similarly Y,Z.
as shown below
X- a.txt,b.txt,c.txt
Y- a.txt,b.txt,c.txt
Z-... (4 Replies)
Discussion started by: phoenix_nebula
4 Replies
7. Programming
Hi,
Currently my STDOUT is configured as tty0,
Is there a way to change it during runtime?
I need to use this serial for other external device
Thanks,
Alex (2 Replies)
Discussion started by: alex889
2 Replies
8. UNIX for Dummies Questions & Answers
Hello every1.
Can any1 help me with the col command.
Wat is a reverse line feed.
Which kind of files u need to use the col command. (2 Replies)
Discussion started by: rahulrathod
2 Replies
9. UNIX for Advanced & Expert Users
Hi All,
I am talking about unix col(1) command used for some reverse line filtering etc.
And I notice that the stdout of this command is line buffered i.e. the stdout will flush the data in its buffer line by line. So the number of writes performed by stdout are more.
So now if I make stdout... (0 Replies)
Discussion started by: sunilsbjoshi
0 Replies
10. UNIX for Advanced & Expert Users
Hello Can Any1 tell me the difference between the col command and the col command with the -f option.
I tried running both of them but i can't see any difference.
Please guide me. (1 Reply)
Discussion started by: rahulrathod
1 Replies
col(1) General Commands Manual col(1)
NAME
col - Filters text containing linefeeds
SYNOPSIS
col [-bfhpx] [-l number]
The col command reads from standard input and writes to standard output.
STANDARDS
Interfaces documented on this reference page conform to industry standards as follows:
col: XCU5.0
Refer to the standards(5) reference page for more information about industry standards and associated tags.
OPTIONS
Assumes that the output device in use is not capable of backspacing. In this case, if two or more characters are to be displayed in the
same position, only the last one that is read is displayed in the output. This function is useful for converting nroff output to produce
readable results on terminals or printers that do not support underlining or overstriking characters. Suppresses the default treatment of
half-line motions in the input. Normally, col does not emit half-line motions on output, although it does accept them in its input. With
this option, output may contain forward half-linefeeds (<ESC-9>), but not reverse linefeeds (<ESC-7> or <ESC-8>). [Tru64 UNIX] Compresses
spaces into tabs. This is the default. [Tru64 UNIX] Buffers at least number lines in memory. By default, 128 lines are buffered. Dis-
plays unknown escape sequences as characters, subject to overprinting from reverse line motions. Normally, col ignores them. You should
be fully aware of the textual position of escape sequences before you use this option. Outputs multiple spaces instead of tabs.
OPERANDS
None
DESCRIPTION
The col command performs the line overlays implied by reverse linefeeds (ASCII <ESC-7>), and by forward and reverse half-linefeeds (ASCII
<ESC-9> and ASCII <ESC-8>). It also replaces white-space characters with tabs where possible.
[Tru64 UNIX] The col command is particularly useful for filtering multicolumn output made by the nroff and tbl commands.
The col command assumes that the ASCII control characters SO ( 17) and SI ( 16) begin and end text in an alternate character set. The
col command remembers the character set each input character belongs to, and on output generates SI and SO characters as appropriate to
ensure that each character is printed in the correct character set.
On input, the col command accepts only the control characters for the <Space>, <Backspace>, <Tab>, and <Return> keys; the newline charac-
ter; the SI, SO, and VT control characters; and <ESC-7>, <ESC-8>, or <ESC-9>. The VT control character ( 13) is an alternate form of full
reverse linefeed included for compatibility with some earlier programs of this type. The col command discards all other nonprinting char-
acters.
[Tru64 UNIX] If the input attempts to back up to the last flushed line, col displays a warning message.
NOTES
Depending on the printer, using the -x option may increase printing time. Local vertical motion that causes a backwards move over the
first line of input is ignored. The first line of input may not have any superscripts. This command is marked LEGACY in XCU Issue 5.
EXIT STATUS
The following exit values are returned: Successful completion. An error occurred.
ENVIRONMENT VARIABLES
The following environment variables affect the execution of col: Provides a default value for the internationalization variables that are
unset or null. If LANG is unset or null, the corresponding value from the default locale is used. If any of the internationalization vari-
ables contain an invalid setting, the utility behaves as if none of the variables had been defined. If set to a non-empty string value,
overrides the values of all the other internationalization variables. Determines the locale for the interpretation of sequences of bytes
of text data as characters (for example, single-byte as opposed to multibyte characters in arguments). Determines the locale for the for-
mat and contents of diagnostic messages written to standard error. Determines the location of message catalogues for the processing of
LC_MESSAGES.
SEE ALSO
Commands: deroff(1), neqn(1), nroff(1), tbl(1)
Standards: standards(5)
col(1)