Please be careful - that trick with awk works because when converting a field to a numerical value, awk will start at the beginning of the field and scan until an unconvertible char is encountered - which is "\" "r" in post#2. Yes - it's not <CR> but two normal chars.
The second assignment really has a <CR> char in it, making echo overprint the first chars.
To remove the <CR>, you can try this bashism (pattern substitution expansion):
or e.g.
Hi,
I have a situation where I need to remove the carriage return between the lines.
For.eg.
The input file:
1,ad,"adc
sdfd",edf
2,asd,"def
fde",asd
The output file should be
1,ad,adc sdfd,edf
2,asd,def fde,asd
Thanks
Shash (5 Replies)
I want to instert Category:XXXXX into the 2. line
something like this should work, but I have somewhere the wrong sytanx. something with the linebreak goes wrong:
sed "2i\\${n}Category:$cat\n"
Sample:
Titel Blahh Blahh abllk sdhsd sjdhf
Blahh Blah Blahh
Blahh
Should look like... (2 Replies)
Guys - Simple code, i am trying to get a number back from sqlplus call to a query. After that, i need to use that number in a loop.
---------------------------------
#!/bin/ksh
VALUE=`sqlplus -silent sh/password@sh <<END
set pagesize 0 feedback off verify off heading off echo off
select... (10 Replies)
Hello, I want remove ^M at end of my files line
if I use command : tr -d '\r' <inp>out it work fine
but get I the same result by manipulating the string ?
I want this because in my text file I manipulate some other part
I have input "the cat^M"
I want output "the cat"
I have made... (3 Replies)
Hi all gurus,
I need help in removing carriage return existed within a record delimited by pipe <|>.
Sample:
A_01|Test1|Testing1|Remarks1
A_02|Test2|Test
ing2|Remarks2
A_03|Test3|Testing3|
Remarks3
Desire output:
A_01|Test1|Testing1|Remarks1
A_02|Test2|Testing2|Remarks2... (10 Replies)
Hi,
I have a pipe delimited file. There are around 700 columns in the file.
The 65th column has carriage return which is causing read issue with our ETL process. I would like to replace the new line characters in 65th field with "nothing"
i have return the following code and need help to... (7 Replies)
I need to remove the carriage return comes inbetween the record.
Need to have CR only at the end.
I used the below command.
tr -d '\n' < filewithcarriagereturns > filewithoutcarriagereturns
But its removing all the CR and giving one line output.
Input File:
12345
abcdegh... (11 Replies)
How to remove Carriage Return (CRLF) within double quotes in a file. There are multiple CRLFs within double quotes. We are on Ubuntu 14.04.2 LTS.
The file that we are importing is a csv file from unix to windows and the file was formatted to unix2dos. Therefore all lines in the file all have... (12 Replies)
Hi All,
My requirement is to remove the carriage return in from the lines which i am reading if the length is lesser than 1330 and append the next line with it. Below is the realistic example of file structure.
Input file:
Blah blah blah blah Blah blah blah blah
Blah blah blah blah Blah... (16 Replies)
Discussion started by: mad man
16 Replies
LEARN ABOUT PHP
sqlsrv_client_info
SQLSRV_CLIENT_INFO(3)SQLSRV_CLIENT_INFO(3)sqlsrv_client_info - Returns information about the client and specified connectionSYNOPSIS
array sqlsrv_client_info (resource $conn)
DESCRIPTION
Returns information about the client and specified connection
PARAMETERS
o $conn
- The connection about which information is returned.
RETURN VALUES
Returns an associative array with keys described in the table below. Returns FALSE otherwise.
Array returned by sqlsrv_client_info
+--------------+-------------------------------------------------+
| Key | |
| | |
| | Description |
| | |
+--------------+-------------------------------------------------+
|DriverDllName | |
| | |
| | SQLNCLI10.DLL |
| | |
|DriverODBCVer | |
| | |
| | ODBC version (xx.yy) |
| | |
| DriverVer | |
| | |
| | SQL Server Native Client DLL version (10.5.xxx) |
| | |
|ExtensionVer | |
| | |
| | php_sqlsrv.dll version (2.0.xxx.x) |
| | |
+--------------+-------------------------------------------------+
EXAMPLES
Example #1
sqlsrv_client_info(3) example
<?php
$serverName = "serverNamesqlexpress";
$connOptions = array("UID"=>"username", "PWD"=>"password");
$conn = sqlsrv_connect( $serverName, $connOptions );
if( $conn === false ) {
die( print_r( sqlsrv_errors(), true));
}
if( $client_info = sqlsrv_client_info( $conn)) {
foreach( $client_info as $key => $value) {
echo $key.": ".$value."<br />";
}
} else {
echo "Error in retrieving client info.<br />";
}
?>
SEE ALSO sqlsrv_server_info(3).
PHP Documentation Group SQLSRV_CLIENT_INFO(3)