09-26-2009
just wanted to add ; at end of last line !
is it possible via shell script?
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi,
Does anyone know if its possible to add something like an end of line like c or java in unix?
dirs=/home/nosnam
var=''
for dir in $dirs
do
listDirs=`ls -d1 $dir/*`
for eachList in $listDirs
do
listRepos=`du -ks $eachList | awk '{ x+=$1 }; END { print x... (4 Replies)
Discussion started by: nosnam
4 Replies
2. UNIX for Advanced & Expert Users
Hi i would like to add line numbers to end of each line in a file.
I am able to do it in the front of each line using sed, but not able to add at the end of the file.
Can anyone suggest
The following code adds line number to start of each line
sed = filename | sed 'N;s/\n/\t/'
how can i... (5 Replies)
Discussion started by: rudoraj
5 Replies
3. Shell Programming and Scripting
Hi Folks,
Using the Vi, how can I add a numbers at the end of the line.
For eg: I have the numbers in the file as:
58.125.33
22.58.68
25.144.225
114.25.38
I need to add .0/8 at the end of all the line. So, it should be like
58.125.33.0/8
22.58.68.0/8
25.144.225.0/8
114.25.38.0/8 (6 Replies)
Discussion started by: gsiva
6 Replies
4. Shell Programming and Scripting
I have a file with varying record length in it. I need to reformat this file so that each line will have a length of 100 characters (99 characters + the line feed).
AU * A01 EXPENSE 6990370000 CWF SUBC TRAVEL & MISC
MY * A02 RESALE 6990788000 Y... (3 Replies)
Discussion started by: udelalv
3 Replies
5. Shell Programming and Scripting
Hello
How can I add a string (always the same) at the end of a specific line in a file...
The file is:
000000001 041 L $$aspa
000000001 088 L $$aJ.E.N. 551
000000001 090 L $$aINFORMES JEN
000000001 100 L $$aautor 1
----
000000002 041 L $$aeng
000000002 088 L $$aJ.E.N. 1... (13 Replies)
Discussion started by: ldiaz2106
13 Replies
6. Shell Programming and Scripting
hi,
In my input file i have less number of pipe symbol , it is suppose to be 10 pipe symbol. If the inputfile have less than 10 pipesymbol then i need append upto 10 pipe symbol.
please help to solve problem.
Input file :
abc|xyz|
1|2|3|4|5|
s|
1|2|||||||||
Output file :
... (4 Replies)
Discussion started by: Jairaj
4 Replies
7. Shell Programming and Scripting
How to add a comma at the end of each line in this file?30 1412
30 3352
30 5254
30 5543
30 7478
3 28
3 30
3 39
3 54
3 108
3 152
3 178
3 182
3 214
3 271
3 286
3 300
3 348
3 349
3 371 (3 Replies)
Discussion started by: gunjan
3 Replies
8. Shell Programming and Scripting
Hai,
I have got a small requirement in my script. and i am using bash shell. I need to add a dot (.) for some particular line in a file. Say for example,
$Cat rmfile
1 This is line1
2 This is line2
3 This is line3
O/p should be :
$Cat rmfile
1 This is line1
2 This is line2. #... (2 Replies)
Discussion started by: Sivajee
2 Replies
9. Shell Programming and Scripting
i want to add a white-space at the end of each line for my inp.file, but when i do it, the result is a new line with a white-space between each line!
my input:
2012 0811 1223 15.2 L 38.393 46.806 9.0 Teh 78 0.5 6.5LTeh 1
GAP=74 ... (5 Replies)
Discussion started by: saeed.soltani
5 Replies
10. Shell Programming and Scripting
Seems simple but ive been searching for a good hour of so
I have a text file and would like to add a string to the end of line 5 ( as an example)
to ake tings hard the line number we have to add the text to is stored in a variable cunningly name $Line_to_append
any ideas on how this could... (2 Replies)
Discussion started by: dunryc
2 Replies
LEARN ABOUT DEBIAN
mdb-sql
MDBTools(1) MDBTools(1)
NAME
mdb-sql - SQL interface to MDB Tools
SYNOPSIS
mdb-sql [-HFp] [-d delimiter] [-i file] [-o file] [database]
DESCRIPTION
mdb-sql is a utility program distributed with MDB Tools.
mdb-sql allows querying of an MDB database using a limited SQL subset language.
OPTIONS
-H Supress header row.
-F Supress footer row.
-p Turn off pretty printing. By default results are printed in an ascii table format which looks nice but is not conducive to manipu-
lating the output with unix tools. This option prints output plainly in a tab separated format.
-d Specify an alternative column delimiter. If no delimiter is specified, columns will be delimited by a tab character if pretty print-
ing (-p) is turned off. If pretty printing is enabled this option is meaningless.
-i Specify an input file. This option allows an input file containing the SQL to be passed to mdb-sql. See Notes.
-o Specify an output file. This option allows the name of an output file to be used instead of stdout.
COMMANDS
mdb-sql in interactive mode takes some special commands.
connect to <database>
If no database was specified on the command line this command is necessary before any querys are issued. It also allows the switch-
ing of databases once in the tool.
disconnect
Will disconnect from the current database.
go Each batch is sent to the parser using the 'go' command.
reset A batch can be cleared using the 'reset' command.
list tables
The list tables command will display a list of available tables in this database, similar to the mdb-tables utility on the command
line.
describe table <table>
Will display the column information for the specified table.
quit Will exit the tool.
SQL LANGUAGE
The currently implemented SQL subset is quite small, supporting only single table queries, no aggregates, and limited support for WHERE
clauses. Here is a brief synopsis of the supported language.
select:
SELECT [* | <column list>] FROM <table> WHERE <where clause>
column list:
<column> [, <column list>]
where clause:
<column> <operator> <literal> [AND <where clause>]
operator:
=, =>, =<, <>, like, <, >
literal:
integers, floating point numbers, or string literal in single quotes
NOTES
When passing a file (-i) or piping output to mdb-sql the final 'go' is optional. This allow constructs like
echo "Select * from Table1" | mdb-sql mydb.mdb
to work correctly.
The -i command can be passed the string 'stdin' to test entering text as if using a pipe.
ENVIRONMENT
MDB_JET3_CHARSET
Defines the charset of the input JET3 (access 97) file. Default is CP1252. See iconv(1).
MDBICONV
Defines the output charset. Default is UTF-8. mdbtools must have been compiled with iconv.
MDBOPTS
semi-column separated list of options:
o use_index
o no_memo
o debug_like
o debug_write
o debug_usage
o debug_ole
o debug_row
o debug_props
o debug_all is a shortcut for all debug_* options
HISTORY
mdb-sql first appeared in MDB Tools 0.3.
SEE ALSO
gmdb2(1) mdb-export(1) mdb-hexdump(1) mdb-prop(1) mdb-ver(1) mdb-array(1) mdb-header(1) mdb-parsecsv(1) mdb-schema(1) mdb-tables(1)
AUTHORS
The mdb-sql utility was written by Brian Bruns.
BUGS
The supported SQL syntax is a very limited subset and deficient in several ways.
0.7 13 July 2013 MDBTools(1)