but neither can produce your required output as no e.g. 2020-01-05 020012 is in your input data.
With strange problems like this, I usually presume non-printing control characters in file, like the DOS line terminator <CR> (\r = ^M = 0x0D).
Hi,
Let's say that I have a file called table, I know that if I need to see a the second column for exampls I use:
awk ' {print $2}' table.txt
Is there anyway to use awk to actually cut a column and put it somewhere else in the table?:confused: (8 Replies)
Hello,
I am trying to solve for a couple of hours now the following problem:
I have n files and would like to add the third column of each file to a new file:
temp1.txt
1 2 3
1 2 3
1 2 3
temp2.txt
1 2 4
1 2 4
1 2 4
1 2 4
temp3.txt (2 Replies)
I have this text file with a very large number of columns (10,000+) and I want to move the first column to the position of the six column so that the text file looks like this:
Before cutting and pasting
ID Family Mother Father Trait Phenotype
aaa bbb ... (5 Replies)
Hi All,
I have two sets of files.
One set with extension .txt This set has file names with numbers like these. 1.txt, 2.txt, 3.txt until extactly 100.txt.
The .txt files look like these:
0.38701788 93750
0.38622013 94456
0.38350296 94440
0.38282126 94057
0.38282126 94439
0.35847232... (1 Reply)
Hi All,
I already have a code which replaces column 14 of NPBR.XTR.tmp with column 8 of NPBR3G.XTR.final
awk -F'\|' 'FNR==NR{a= $2"^"$8;next;}a{split(a,b,"^");$8=b;$14=b;}1' OFS="|" ${SHTEMP}NPBR3G.XTR.final ${SHTEMP}NPBR.XTR.tmp > ${SHTEMP}NPBR.XTR.final
I also need to replace column 15... (2 Replies)
Hi all,
I've multiple files. In this case 5. Space separated columns. Each file has 12 columns. Each file has 300-400K lines.
I want to get the output such that if a value in column 2 is present in all the files then get all the columns of that value and print it side by side.
Desired output... (15 Replies)
Hi,
I'm trying to copy and paste the sixth column from a bunch of files into a single file having each column pasted in separate columns (and not one after each other in just one column.)
I tried this code but works only partially because it copied and pasted 50 rows of each column... (6 Replies)
Discussion started by: Frastra
6 Replies
LEARN ABOUT DEBIAN
asql
ASQL(8) Perl Programmers Reference Guide ASQL(8)NAME
asql - Provide an SQL interface to Apache logfiles.
SYNOPSIS
asql [options]
General Options:
--help Show brief help intstructions.
--manual Show more complete help.
--version Show the version of the software.
Scripting Options:
--load Load the named file, or glob.
--execute Execute a single query then exit.
Options:
--file Rather than running as a shell read commands from a named file.
--quiet Don't show the banner at startup.
DESCRIPTION
asql provides a simple console interface to allow a user to
query the contents of an Apache logfile via an SQL interface.
The shell features include:
Persistent alias definitions.
Command line completion
Command history
Simple scriptability
INTRODUCTION
The asql shell will create a temporary SQLite database based upon
any number of Apache logfiles. This temporary database may then
be interactively queried using common SQL syntax.
To get started you should load your logfiles into the database:
load /var/log/apache2/acces*
(The tool will automatically decompress files which have been
compressed with gzip or bzip2.)
Once you've loaded at least one file you may run queries, for
example:
SELECT source,SUM(size) AS Number FROM logs GROUP BY source ORDER BY Number DESC, ip
This example shows all the clients connecting to your webserver
and the size of files/requests that they have downloaded in total.
As you can see we've selected two columns "source" and "SUM(size)".
To see which other columns are available you may execute the "show"
command.
Because parsing the Apache logfile(s) specified might be quite
slow there is the option of dumping the temporary SQLite database
to a known filename with the 'save' command. The analog to the
save command is the 'restore' command, which will read in an
existing SQLite database and allow future queries to be executed
against it.
FILES
When the shell starts up it will read and intepret the initialisation
file of ~/.asqlrc if it exists. Any commands present in that file
will be executed prior to the launch of the interactive session.
All aliases will be read and written to the file ~/.asql.aliases.
All interactive history will be written to the file ~/.asql.
AUTHOR
Steve
--
http://www.steve.org.uk/
LICENSE
Copyright (c) 2007,2008,2009,2010 by Steve Kemp. All rights reserved.
This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. The LICENSE file contains the
full text of the license.
AUTHOR
Steve
--
http://www.steve.org.uk/
LICENSE
Copyright (c) 2007-2020 by Steve Kemp. All rights reserved.
This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. The LICENSE file contains the
full text of the license.
perl v5.10.1 2010-10-04 ASQL(8)