08-22-2017
Neither ... nor. The
$1 = $1 trick replaces ALL field separators (multiples as well) with the OFS char without modifying the fields' contents.
man awk:
Quote:
Assignment to $0 causes the fields and NF to be recomputed. Assignment to NF or to a field causes $0 to be reconstructed by concatenating the $i's separated by OFS.
This User Gave Thanks to RudiC For This Post:
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi,
In ksh, I have a file with similar rows as follows:
Department = 1234 G/L Asset Acct No = 12.0000. 2/29/2008
Department = 1234 G/L Asset Acct No = 13.0000. 3/29/2008.
I want to create a new text file that contains only the numbers and date:
1234 12.0000. 2/29/2008
1234 13.0000. ... (16 Replies)
Discussion started by: ihot
16 Replies
2. Shell Programming and Scripting
I have huge fixed width, text file in unix box and I need to extract columns found between the width 105 and 200 and output it to a new file.
Can anyone tell me how to extract it?
Thanks for your help. (1 Reply)
Discussion started by: kiran2k
1 Replies
3. Shell Programming and Scripting
hi experts
lets say my format file is B
B
=========
column no,name,type,length
1,ee,N,12
3,hj,N.4
4,kl,N,5
source file
========
d e f g h i
5 8 9 7 6 5
1 3 4 5 6 6 (2 Replies)
Discussion started by: subhendu81
2 Replies
4. Shell Programming and Scripting
Hi All,
Could you please help me with following:
I have to parse a .csv file.
For example: If the csv file contains 3 columns, then i have to print the column names. The field separator is (comma).
example.csv (contains 2 lines as follows)
This is,a test file, for validation... (2 Replies)
Discussion started by: vfrg
2 Replies
5. Shell Programming and Scripting
Hi,
My first file has
592155 9 rs16916098 1
592156 19 rs7249604 1
592157 4 rs885156 1
592158 5 rs350067 12nd file has
9 rs16916098 0 113228129 2 4
19 rs7249604 0 58709070 4 2
2 rs17042833 0 113558750 4 2... (2 Replies)
Discussion started by: genehunter
2 Replies
6. Shell Programming and Scripting
Hi All,
I have to match each row in file 1 with 1st row in file 2 and print the corresponding column from file2. I am trying to use an awk script to do this. For example
cat File1
X1
X3
X4
cat File2
ID X1 X2 X3 X4
A 1 6 2 1
B 2 7 3 3
C 3 8 4 1
D 4 9 1 1 (3 Replies)
Discussion started by: newpro
3 Replies
7. Shell Programming and Scripting
Hi all, I know this sounds suspiciously like a homework course; but, it is not.
My goal is to take a file, and match my "ID" column to the "Date" column, if those conditions are true, add the total number of minutes worked and place it in this file, while not printing the original rows that I... (6 Replies)
Discussion started by: mtucker6784
6 Replies
8. Shell Programming and Scripting
Hello All,
I have a requirement in which i will be given a sql query as input in a file with dynamic number of columns. For example some times i will get 5 columns, some times 8 columns etc up to 20 columns.
So my requirement is to generate a output query which will have 20 columns all the... (7 Replies)
Discussion started by: vikas_trl
7 Replies
9. Shell Programming and Scripting
Hi, I have been looking everywhere for an example so I can try and do this myself but I am having difficulty. I have 2 large files of different sizes and if the pattern in the 3rd column in file 1 is in "any" column in file 2 I want to print all of the line in file 1 and append that line with the... (5 Replies)
Discussion started by: kieranfoley
5 Replies
10. Shell Programming and Scripting
I have a comma delimited file as per the one below and I am currently extracting the values in 2 columns (COL1 & COL6) to produce a smaller trimmed down version of the file which only contains the columns we need;
COL1,COL2,COL3,COL4,COL5,COL6,COL7,COL8,COL9... (1 Reply)
Discussion started by: Ads89
1 Replies
LEARN ABOUT DEBIAN
ost_applog_ident
ost::AppLog::Ident(3) Library Functions Manual ost::AppLog::Ident(3)
NAME
ost::AppLog::Ident -
Ident class that represents module name.
SYNOPSIS
#include <applog.h>
Public Member Functions
Ident ()
Constructor.
~Ident ()
Desctructor.
Ident (Ident &id)
Copy constructor.
Ident (const char *str)
const char* constructor, provided for convenience.
std::string & str ()
std::string cast.
Ident & operator= (std::string &st)
Assignment operator (string).
Ident & operator= (const char str[])
Assignment operator (const char[]), provided for convenience.
const char * c_str ()
const char* cast provided for conveneince.
Detailed Description
Ident class that represents module name.
Constructor & Destructor Documentation
ost::AppLog::Ident::Ident () [inline]
Constructor.
ost::AppLog::Ident::~Ident () [inline]
Desctructor.
ost::AppLog::Ident::Ident (Ident &id) [inline]
Copy constructor.
ost::AppLog::Ident::Ident (const char *str) [inline]
const char* constructor, provided for convenience.
Member Function Documentation
const char* ost::AppLog::Ident::c_str () [inline]
const char* cast provided for conveneince.
Referenced by ost::AppLog::operator()(), and ost::AppLog::operator<<().
Ident& ost::AppLog::Ident::operator= (std::string &st) [inline]
Assignment operator (string).
Ident& ost::AppLog::Ident::operator= (const charstr[]) [inline]
Assignment operator (const char[]), provided for convenience.
std::string& ost::AppLog::Ident::str () [inline]
std::string cast.
Author
Generated automatically by Doxygen for GNU CommonC++ from the source code.
GNU CommonC++ Sat Jun 23 2012 ost::AppLog::Ident(3)