To make it easier, i gave following example. It is not homework or classwork. Instead, i have a huge csv file dump from tsql with 15 columns and around 300 rows. I was able to extract content that needs to be really converted. Here is the extract:
desire result should be:
based on sorting of field f4.
to make it simple, I created two files using grep for I and N but don't know how to append the third column if f1,f2 are same using comma as delim.
=========================
UNIX compare, sort lines and append difference
Hi,
Hi all
i am very new to shell scripting,hope u guys can help
i need to replace,sort and append character for the file that look like this:
1007032811010001000100000001X700026930409
1007032811010001000200000002X700026930409
1007032711020001000300000003X700026930409... (2 Replies)
I need to write a Shell Script to compare two files & display the result. If the two files are different append them and store them in a new file. How do i proceed...can someone give me a coding ? (3 Replies)
I have two files like this:
#FILE 1
ABCD 4322 26485
JMTJ 5311 97248
XMPJ 4321 58978
#FILE 2
ABCD 4321 26485
JMTJ 5311 97248
XMPJ 4321 68978
What to do: Compare the two files and find those lines that doesn't match. And have a new file like this:
#FILE 3
"from file 1"
ABCD 4322 26485... (11 Replies)
Hi,
I am using some codes that have been ported from unix to linux, and now the sorting no longer results in the desired ordering. I'm hoping to find a way to mimic the unix sort command in linux. The input file is structured the following:
$> cat file.txt... (6 Replies)
Hello all -
I am to this forum and fairly new in learning unix and finding some difficulty in preparing a small shell script. I am trying to make script to sort all the files given by user as input (either the exact full name of the file or say the files matching the criteria like all files... (3 Replies)
I have output like this:
USER_ID
12/31/69 19:00:00
12/31/69 19:00:00
USER_ID
12/31/69 19:00:00
12/31/69 19:00:00
USER_ID
12/31/69 19:00:00
12/31/69 19:00:00
USER_ID
12/31/69 19:00:00
12/31/69 19:00:00
...
where USER_ID is a unique user login followed by their login timestamp and... (6 Replies)
To make it easier, i gave following example. It is not homework or classwork. Instead, i have a huge csv file dump from tsql with 15 columns and around 300 rows. I was able to extract content that needs to be really converted. Here is the extract:
ES FP,B1ES FP,70000,I,SL22,SL22 (70000)
ES... (8 Replies)
Hello,
I have two files file 1 and file 2 each having result of a query on certain database tables and need to compare for Col1 in file1 with Col3 in file2, compare Col2 with Col4 and output the value of Col1 from File1 which is a) not present in Col3 of File2 b) value of Col2 is different from... (2 Replies)
Hi,
Could anyone kindly show me a link or explain the difference between
sort -n -k2 -k3 & sort -n -k2,3
Also, if I like to remove the row with repetition at both $2 and $3, Can I safely use
sort -u -k2 -k3
Example;
100 20 30
100 20 30
So, both $2 and $3 are same and I... (2 Replies)
Discussion started by: Indra2011
2 Replies
LEARN ABOUT DEBIAN
tsql
tsql(1) FreeTDS Utilities tsql(1)NAME
tsql - utility to test FreeTDS connections and queries
SYNOPSIS
tsql { -S servername [-I interface] | -H hostname -p port }
-U username [-P password] [-o options]
tsql -C
DESCRIPTION
tsql is a diagnostic tool provided as part of FreeTDS. It uses the TDS protocol directly to connect to Sybase or Microsoft SQL Servers, and
allows the user to issue queries that test the capabilities of FreeTDS.
tsql is *not* a replacement for a complete isql, such as sqsh (www.sqsh.org). It is designed to rely on the lowest level FreeTDS library,
tdslib, as a way to isolate potential bugs in the protocol implementation.
tsql can be run in two ways, one which uses the freetds.conf and one which connects directly using the server's hostname and port.
When -S is used, FreeTDS uses the freetds.conf (or equivalent) and environment variables in the normal way to determine the server's ip
address and port. You can use -I to specify a filename, overriding FreeTDS's configuration file search algorithm.
The -H and -p parameters are provided especially for troubleshooting new configurations (or servers). Use of these parameters causes
FreeTDS to ignore any freetds.conf and environment variables.
OPTIONS -S servername
the Database Server to which to connect.
-I interface
a freetds.conf or interfaces file describing servername
-H hostname
the DNS hostname of the server
-p port
the port at which SQL Server is listening
-U username
database login name. If username is not provided, a domain login is attempted for TDS 7+ connections.
-P password
database password.
-L list server "instances" (with -H)
-C prints some of the compile-time configuration parameters.
-o options
apply the options specified to every command.
f No footer [result count]
h No header [titles]
t Print time
v Print version
q Quiet
NOTES
Typing "exit", "quit", or "bye" (or ^D) exits tsql.
Typing "version" displays the TDS protocol version.
Command batches may be separated with "go" or "GO". If "GO", the version string is reported before executing the batch.
After prompting for the password, tsql will attempt to connect to the remote
server.
tsql displays a counter indicating the number of seconds that
it is attempting to connect.
Typically, tsql should immediately respond
with a '1>' prompt.
If you see the counter (1, 2, 3, ...), most likely tsql is unable to connect to the indicated server.
If you can connect with "tsql -S servername", your basic FreeTDS installation is working.
If you have suggestions for ways to make tsql more useful as a diagnostic tool, please recommend them to the FreeTDS mailing list for con-
sideration.
HISTORY
tsql first appeared in FreeTDS 0.60.
AUTHORS
The tsql utility was written by Brian Bruns.
BUGS
Several, to be sure, now that it's documented. :)
doc 13 November 2011 tsql(1)