Programming :: Ignoring Commas Within Double Quotes?

Nov 4, 2010

I'm trying to write a bash script that has to extract values from a csv file. Problem is there are lines like this:a,b,c,"dd,dd,dd",e,f,gI'm using awk to extract the values but when I try it extract value 4 with awk I get:"ddinstead of:"dd,dd,dd"Does anyone know how to get awk to ignore commas within double quotes?

View 5 Replies


ADVERTISEMENT

Programming :: Double Quotes Inside Double Quotes?

Jun 6, 2010

In bash I need to use some equivalent of double quotes inside double quotes (or the other way around.)I need to run the following statement to get the output of foo and store it in a variable while passing foo the $file which probably contains spaces.

Code:
variable=$(foo "$file")
The problem is that foo might return an empty string and if it does I need to catch it

[code]...

View 6 Replies View Related

Programming :: Remove Double Quotes Bash?

Jul 20, 2011

grep -e XkbLayout /etc/X11/xorg.conf | grep -v "^#" | awk '{print $3}'

output = "gb"
sometimes= "us"

View 4 Replies View Related

Ubuntu :: Double Quotes And Single Quotes Not Working In 11.04?

Aug 2, 2011

I am not sure If anybody has faced this issue, my keyboard is less responsive when pressing the double quote/single quote key, I have to press it twice for it to print the quote( and that too it prints some other data and not exactly a double-quotes). Initially I thought it was issue with my keyboard, but later I see that it is working fine in Windows XP. It looks some kind of setting issue. If you check the below two examples, example a) is the double quote printed in Ubuntu, it doesnt exactly looks like a double-quotes and b) is the one printed in Windows.

View 1 Replies View Related

Programming :: Double-quotes Do Not Escape Properly (bash=python)?

May 2, 2010

I wrote the Automatik widget (you can find it at :http://kde-look.org/content/show.php...&PHPSESSID=caeTo improve it, I would like to add this one-line script into a text sensor :

top -b -n 1 | head -12 | tail -6 | sed '/top/d' | awk '{ printf "%-12.12s %-4s %-4s %-3s
" , $12,$9,$10,$2}'

[code]...

View 3 Replies View Related

General :: How To Use Rsync When Filenames Contain Double Quotes

Jan 29, 2011

I am trying to synchronize the content of the directory my_dir/ from /home to /backup. This directory contains a file which name has a double quote in it, such as to"to. Here is my rsync command:
rsync -Cazh /home/my_dir/ /backup/my_dir/

And I get the following message:
rsync: mkstemp "/backup/my_dir/.to"to.d93PZr" failed: Invalid argument (22)
For info, rsync works well when the synchronized filenames contain single quote, parenthesis and space. Thus, why is it bugging with a double quote?

View 3 Replies View Related

Ubuntu :: Sed Finding Item That Contains Double Quotes?

Jul 28, 2011

trying to edit a huge configuration filer graphviz that containsIP addresses.unfortunately, some of the IP addresses didn't get parsed right and have only 3 octets. I am trying to use sed to find these 3 octet lines and delete the line entirely.example lines in the file look like this.

"22.210.73" -> "192.168.159";
"22.210.232" -> "22.210.248";

i have tried doing various things but to no avail. i had something that looked like this...

sed -i '/"*.*.*"/d' myfile

View 2 Replies View Related

Red Hat / Fedora :: Replacing SNOWMAN With Double Quotes Using Sed?

Feb 24, 2010

We have 'SNOWMAN' UTF-8 character in our files which i need to replace with doublequotes (").The UTF-8 hex value for 'SNOWMAN' is 0xE2 0x98 0x83 (e29883) , I have written the commands like this but it is not working .........sed -i 's/x0xE2 0x98 0x83/"/g' FileName

View 8 Replies View Related

General :: Escaping Double Quotes In A File?

Dec 12, 2010

I know it is pretty trivial but anyway...I have php file that I am trying to read it looks like this

...
add_item_tabulky("Klaun-PF 2011","klaun_pf2011.jpg","","","");
add_item_tabulky("Pras�tko-�ťastn�

[code]...

View 3 Replies View Related

Fedora :: Keyboard: Single And Double Quotes Not Working?

Jan 21, 2010

I have a problem with my keyboard. I�m unable to type single or double quotes, at least not the regular sort that you need to write code in almost any programming language ever invented -which makes it pretty useless.A demonstration.Single left and right tilted quotes:Double quotes: m not able to type a single straight quote at all.I just want my keyboard layout to be standard US like everyone elses so I can get on with my work so does anybody know how to just reset it to a normal layout?

View 4 Replies View Related

Ubuntu :: Shell Curly Braces With Double Quotes Does Not Expand As Expect?

Jan 13, 2011

I'm really new here this is the first try to get some knowledge here.I have a littele question."echo {1,2}" does expands 1 and 2.so does "echo "`echo {1,2}`"".But when I do it with double quotes which is "echo "{1,2}"" it doesn't expand at all.why does this happen? I have read man for bash but could not get any clue.

Yuki
Code: -- the output i see --
sh-3.2# echo {1,2}

[code]...

View 3 Replies View Related

Programming :: C++: Macro Not Defined In Quotes?

Dec 12, 2009

I converted my programming project over to autotools, which gives me a config.h file with all the cool definitions, like these ones:

Code:

/* Location of data files. */
#define DATADIR "/usr/local/share"
/* Define to the full name of this package. */
#define PACKAGE_NAME "lusus"

And naturally I think this is cool because then I can hardcore these into the binary. To my dismay, however, I discovered that the pre-processor does not do the text-substitution if the macro name is inside another quoted string.

Code:

// Prints out "/usr/local/share/lusus"
std::cout << DATADIR << "/" << PACKAGE_NAME << "
";

[code]....

This seems lame, because then this doesn't work:

Code:

CL_Image leaves_corner_tl(gc, "DATADIR/PACKAGE_NAME/img/leaves_corner_tl.png");

So, am I literally going to have to strcat DATADIR/PACKAGE with the other text every time I want to prefix DATADIR/PACKAGE_NAME onto another string?

View 2 Replies View Related

Programming :: Getting Rid Of Quotes When Dragging A File Into The Terminal

Feb 18, 2010

The following script will work when I type the path to the file I want to checksum, but not when I drag the file to the terminal because the linux terminal (unlike the Mac) automatically puts quotes around the file path, which causes an error. (Clarification: am referring to gnome-terminal. Thanks, GrapefruiTgirl.) I did not find anything in gconf-editor or anywhere else to alter this behaviour, and my post in Launchpad is unanswered so far. (the script in itself is not very useful, I just stumbled upon this error when experimenting with bash).

So, is there a workaround for stripping the quotes from the input, or can I configure the terminal to not quote the input when I drag a file into it (which I would prefer?)

I am currently logged in from Mac OS, but the question refers to ubuntu karmic with which I dual boot.

View 6 Replies View Related

Programming :: Python - String To Omit The Single Quotes (')?

Mar 18, 2011

After I assign a string to a variable, I know that the print function will remove the single quotes around the value, but is there a way to assign a variable without the quotes around the value? for example:

a = open('/usr/lib', 'r+')
b = f.read()
c = x.replace('.xx','yy')
d = ?

c returns the value with quotes around it print c returns the value without the quotes Is there a way to assign a new variable (d) which will equal c without the quotes? I need a new variable which has the quotes omitted because from there the script will take the value of the last variable (which is a path to a file), and tar up that file. It won't recognize the path to the file if the value has quotes around it.

View 1 Replies View Related

Programming :: Grep Ignoring Spaces Or Tabs?

Jun 29, 2010

I writing a script to go through multiple reports. I want to grep daemon.debug @10.10.10.10 on all reports to make sure it is pointing to the right IP address. the problems is the space between debug and @10 are different on all the reports, some have one space some have two and some have tabs how do I ignore the tabs or spaces and grep daemon.debug @10.10.10.10

daemon.debug /var/log/ftp rotate size 20m files 4 compress
daemon.debug @10.10.10.10
authpriv.* /var/log/secure rotate size 20m files 4 compress
authpriv.* @10.10.10.10

View 6 Replies View Related

Programming :: Checking Pattern But Ignoring Multiple Space?

Apr 8, 2010

i am searching a string(with multiple words) in a file that file contains the string but words are separated with multiple white space.

ex: pattern to be matched "hello how are you" all single white space and file contains " hello how are you" variable white space between words

grep "pattern" file_in_which_to_search i am reading the "pattern" so i cannot modify the "pattern"

so my pattern match does not take place, though i want it to match.

View 3 Replies View Related

Programming :: Warning: Ignoring Return Value Of Size_t Write?

Nov 1, 2010

I've just moved onfrom developing some code on Debian (gcc 4.1) to Ubuntu (gcc4.4) and a warning in my g++ code has appeared. Basically in some serial prot code I get this errorwarning: ignoring return value of 'ssize_t write(int, const void*, size_t)', declared with attribute warn_unused_resultfrom function

void TxChar(COMPORT *port,unsigned char letter)
{
pthread_mutex_lock( &txmutex );

[code]....

View 7 Replies View Related

Programming :: Reading A Binary File (Ignoring Null Terminator)

Jan 12, 2011

I need to read a binary file using my C++ application. That binary file may contain arbitary characters and it also contains 0 at some places. I need to read the file without considering null terminating character. (i.e. considering 0 as a normal byte and not as the end of the string)Can some one suggest me a method to read the buffer while ignoring the null terminated character.

View 4 Replies View Related

Programming :: Convert From Hex String To Double In C/c++?

Apr 5, 2010

Someone know how i can convert from hex string to double in c/c++?? Example 40668472B020C49C is 180.139

reference page: http://babbage.cs.qc.edu/IEEE-754/64bit.html

View 10 Replies View Related

Programming :: Using /dev/random To Generate Double?

Mar 6, 2010

I need to generate random numbers using /dev/random in C. The numbers should be of type double (64-bit floating point).The functionality should be equal to linux command "od -An -N8 -t fD /dev/random", but written in C.The prototype should be "double drand(void);".

View 7 Replies View Related

Programming :: Double Data Type Mantissa?

Nov 23, 2010

in c/c++, double is usually 8 bytes. It has a 52-bit mantissa (or significand, or base), an 11-bit exponent, and a 1-bit sign. My question is: is the mantissa a 52-bit integer? Or is the decimal point just after the first bit. Meaning: if the mantissa was 1000110011100011 (in binary) would that make the value of the mantissa (assuming the exponent was 0) 1000110011100011, or 1.000110011100011? (in binary)

View 1 Replies View Related

Programming :: [C++] Writing Double Value To A Text File?

Jun 3, 2011

Code:
int main ()
{

[code]...

View 9 Replies View Related

Programming :: Bubble Sort For Array Of Double?

May 10, 2010

Here's my code for bubble sort with double type

Code:
#include <stdio.h>
void swap_double( double *a, double *b )
{
double _t = *a;
code....

View 1 Replies View Related

Programming :: SED - Convert Double Quote To Single

Jan 21, 2010

I want to convert double quote to single quote in a text file. I tried escape characters however no success. Please find details as follows:

-sh-3.00$ sed 's/"/'/g test.txt
sed: -e expression #1, char 7: unterminated `s' command
-sh-3.00$ cat test.txt
"unix"

I want "unix" to be converted to 'unix'

View 7 Replies View Related

Programming :: Get The Number Of Left-right-double Click?

Jan 20, 2011

can i get the ocuurance of left click-right click-double click?i need the time of ocurance and the click(left-right-double) that happend.any software?any clue..i need it in linux environment(kde or gnome)

View 14 Replies View Related

Programming :: C Function To Reverse The Byte Order In A Double?

Aug 12, 2010

I'm trying to write an extension to PHP which means coding in C. I'm really really rusty at C coding and was never very good at it.

Can anyone propose an efficient, safe, and [hopefully] future-proof way of reversing a double? Keep in mind that it should work on as many systems as possible and on 32- and 64-bit systems (and on ???-bit systems in the future?). Will the size of a 'double' ever change or will it always be 8 bytes?

I've tried this and it doesn't work...the compiler complains about "invalid operands to binary" because I'm trying bitwise shiftw on a non-integer.

Code:
x = (x>>56) |
((x<<40) & 0x00FF000000000000) |
((x<<24) & 0x0000FF0000000000) |
((x<<8) & 0x000000FF00000000) |

[Code]....

View 3 Replies View Related

Programming :: Ostream<< Operator With Double Variable Is Not Accurate?

Mar 27, 2010

I have tryed out this operator on program:

Code:

#include <iostream.h>
#include <iomanip.h>
#include <fstream.h>
ofstream myfile;

[code]...

which definitly is not the same number. I guess somewhere in the convertion from double to char* ("<<") something is not right and what can i do to save these double numbers in an accurate manner in a file?

View 14 Replies View Related

Programming :: Regular Expression Double Escape For Files That End With .la ?

Mar 18, 2010

I have been battling with regular expressions and am a little lost. I want to find all my files that end with .la and have been trying this

Code:
slocate -r .la$

which finds them but also files like mozilla. The escaped full stop seems to be ignored however this works :

Code:
slocate -r \.la$

so why is the double escaping needed ?

View 3 Replies View Related

Programming :: Smallbin Double Linked List Corrupted?

Jun 27, 2011

My application receiving SIGABRT by saying "smallbin double linked list corrupted". It is developed in C/C++ on Linux RHEL5.4

View 2 Replies View Related

Fedora :: Using Sed To Add Commas To New Lines

Dec 16, 2009

I have some data like below:
interface Vlan1
description Management LAN
interface Vlan41
description Somelan
interface Vlan65
description Some other lan.
service-policy input 2Mbps
service-policy output 2Mbps

How can I get sed to look at this txt file and add a comma at the beginning of every new line between the interface lines. i.e.:
interface Vlan1
,description Management LAN
interface Vlan41
,description Somelan
interface Vlan65
,description Some other lan.
,service-policy input 2Mbps
,service-policy output 2Mbps

View 2 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved